deepxde.nn
deepxde.nn.activations module
- deepxde.nn.activations.get(identifier)[source]
Returns function.
- Parameters:
identifier – Function or string (ELU, GELU, ReLU, SELU, Sigmoid, SiLU, sin, Swish, tanh).
- Returns:
Function corresponding to the input string or input function.
deepxde.nn.initializers module
- class deepxde.nn.initializers.VarianceScalingStacked(scale=1.0, mode='fan_in', distribution='truncated_normal', seed=None)[source]
Bases:
object
Initializer capable of adapting its scale to the shape of weights tensors.
With distribution=”truncated_normal” or “untruncated_normal”, samples are drawn from a truncated/untruncated normal distribution with a mean of zero and a standard deviation (after truncation, if used) stddev = sqrt(scale / n) where n is:
number of input units in the weight tensor, if mode = “fan_in”
number of output units, if mode = “fan_out”
average of the numbers of input and output units, if mode = “fan_avg”
With distribution=”uniform”, samples are drawn from a uniform distribution within [-limit, limit], with limit = sqrt(3 * scale / n).
- Parameters:
scale – Scaling factor (positive float).
mode – One of “fan_in”, “fan_out”, “fan_avg”.
distribution – Random distribution to use. One of “normal”, “uniform”.
seed – A Python integer. Used to create random seeds. See tf.set_random_seed for behavior.
dtype – Default data type, used if no dtype argument is provided when calling the initializer. Only floating point types are supported.
- Raises:
ValueError – In case of an invalid value for the “scale”, mode” or “distribution” arguments.
deepxde.nn.regularizers module
- deepxde.nn.regularizers.get(identifier)[source]
Retrieves a regularizer instance based on the given identifier.
- Parameters:
identifier (list/tuple) – Specifies the type and factor(s) of the regularizer. The first element should be one of “l1”, “l2”, or “l1l2” (“l1+l2”). For “l1” and “l2”, a single regularization factor is expected. For “l1l2”, provide both “l1” and “l2” factors.