ExponentialReg#
- class brainstate.nn.ExponentialReg(weight=1.0, rate=1.0, fit_hyper=False)#
Exponential prior regularization (for positive parameters).
Implements regularization based on the negative log-likelihood of an exponential distribution:
\[L = \lambda \cdot \text{rate} \sum_i x_i\]- Parameters:
Examples
>>> import jax.numpy as jnp >>> from brainstate.nn import ExponentialReg >>> reg = ExponentialReg(weight=1.0, rate=1.0) >>> value = jnp.array([0.5, 1.0, 2.0]) # positive values >>> loss = reg.loss(value)
Notes
Exponential prior encourages small positive values and promotes sparsity. It’s the continuous analog of L1 regularization for positive parameters.