Parameter¶
- class nyx.core.parameter.Parameter[source]¶
Bases:
ModuleA trainable physical parameter with an explicit characteristic scale.
- Variables:
factor (jax.Array) – The only pytree leaf; O(1) for a well-chosen scale.
scale (float) – Characteristic scale in the unconstrained space, static for JIT. Change it via
autoscale().per_obs (bool) – Whether the parameter carries a leading
(nobs, ...)axis aftertile_per_obs().frozen (bool) – Whether the parameter is excluded from optimization.
transform (str or None) –
None(unconstrained),'log'or'softplus'for a positive quantity, or'tanh'for one confined to(-1, 1).
Attributes Summary
d value / d factor, elementwise;scalewhen untransformed.Physical value
transform(factor * scale).Methods Summary
freeze()Return a copy with
frozen=True.from_value(value[, scale, per_obs, frozen, ...])Construct from a physical value.
unfreeze()Return a copy with
frozen=False.Attributes Documentation
- dvalue_dfactor¶
d value / d factor, elementwise;scalewhen untransformed.
- factor = <dataclasses._MISSING_TYPE object>¶
- frozen = False¶
- per_obs = False¶
- scale = 1.0¶
- transform = None¶
- value¶
Physical value
transform(factor * scale).
Methods Documentation
- classmethod from_value(value, scale=None, per_obs=False, frozen=False, transform=None)[source]¶
Construct from a physical value.
- Parameters:
- Return type:
- Raises:
ValueError – If transform is unknown, or value lies outside its domain.
- __init__(factor, scale=1.0, per_obs=False, frozen=False, transform=None)¶
- static __new__(cls, *args, **kwargs)¶