Parameter Containers#
Flexible parameter containers that integrate with BrainState’s module system.
Param supports bijective transformations for constrained optimization and
optional regularization. Const provides non-trainable constant parameters.
Both support automatic caching of transformed values for improved performance.
A module has neural network parameters for optional transform and regularization. |
|
A module has non-trainable constant parameter. |
Parameter Transforms#
Bijective transformations for constrained parameter optimization. These transforms
map between unconstrained and constrained spaces, enabling gradient-based optimization
of parameters with constraints (positivity, boundedness, simplex, etc.). All transforms
implement forward(), inverse(), and optional log_abs_det_jacobian() for
probabilistic applications. Use with Param for automatic constraint handling.
Abstract base class for bijective parameter transformations. |
|
Identity transformation (no-op). |
|
Transformation with clipping to specified bounds. |
|
Affine (linear) transformation with scaling and shifting. |
|
Sigmoid transformation mapping unbounded values to a bounded interval. |
|
Tanh-based transformation mapping (-inf, +inf) to (lower, upper). |
|
Softsign-based transformation mapping (-inf, +inf) to (lower, upper). |
|
Sigmoid transformation with adjustable sharpness/temperature. |
|
Softplus transformation mapping unbounded values to positive semi-infinite interval. |
|
Negative softplus transformation mapping unbounded values to negative semi-infinite interval. |
|
Log transformation mapping (lower, +inf) to (-inf, +inf). |
|
Exponential transformation mapping (-inf, +inf) to (lower, +inf). |
|
ReLU transform with lower bound: forward(x) = relu(x) + lower_bound |
|
Transformation constraining parameters to be strictly positive (0, +∞). |
|
Transformation constraining parameters to be strictly negative (-∞, 0). |
|
Power (Box-Cox) transformation for stabilizing variance. |
|
Transformation ensuring ordered (monotonically increasing) output. |
|
Stick-breaking transformation for simplex constraint. |
|
Transformation to unit vectors (L2 norm = 1). |
|
Composition of multiple transformations applied sequentially. |
|
Selective transformation using a boolean mask. |