ScaledSigmoidT#

class brainstate.nn.ScaledSigmoidT(lower, upper, beta=1.0)#

Sigmoid transformation with adjustable sharpness/temperature.

This transformation extends the standard sigmoid with a scaling parameter (beta) that controls the sharpness of the transition. Higher beta values result in a sharper sigmoid, while lower values produce a smoother transition.

The transformation is defined by:

\[\text{forward}(x) = \text{lower} + \text{width} \cdot \sigma(\beta \cdot x)\]

where \(\sigma(x) = \frac{1}{1 + e^{-x}}\) is the standard sigmoid function.

The inverse transformation is:

\[\text{inverse}(y) = \frac{1}{\beta} \cdot \text{logit}\left(\frac{y - \text{lower}}{\text{width}}\right)\]
Parameters:
  • lower (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Lower bound of the target interval.

  • upper (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Upper bound of the target interval.

  • beta (float) – Sharpness parameter, by default 1.0. Higher values produce sharper transitions.

Examples

>>> # Standard sigmoid
>>> transform = ScaledSigmoidT(0.0, 1.0, beta=1.0)
>>> # Sharp sigmoid
>>> transform_sharp = ScaledSigmoidT(0.0, 1.0, beta=5.0)
>>> # Smooth sigmoid
>>> transform_smooth = ScaledSigmoidT(0.0, 1.0, beta=0.5)
forward(x)[source]#

Transform unbounded input to bounded interval.

Return type:

Array

inverse(y)[source]#

Transform bounded input back to unbounded domain.

Return type:

Array