PositiveT#
- class brainstate.nn.PositiveT#
Transformation constraining parameters to be strictly positive (0, +∞).
This is a convenience class that provides a simple positive constraint using the exponential transformation with lower bound of 0.
The transformation is defined by:
\[\text{forward}(x) = e^x\]The inverse transformation is:
\[\text{inverse}(y) = \log(y)\]Examples
>>> transform = PositiveT() >>> x = jnp.array([-1.0, 0.0, 1.0]) >>> y = transform.forward(x) >>> # y ≈ [0.368, 1.0, 2.718]