MLPPredictor#
- class hybrid_aif.MLPPredictor[source]#
Bases:
ModuleMLP over concatenated parents → a raw output vector, with no density of its own.
The trunk the other classes here are built from; paired with a loss it is a head without a density family (
PredictorHead).depthhidden layers ofwidthunits, each optionally layer-normed (eps 1e-3) then activated, and a final linear toout_dim.- out_activation: bool = False#
Truenorms and activates the final layer too, making the trunk an encoder.
- symlog_inputs: bool = False#
Trueappliessymlog()to the concatenated parents before the first layer.
- classmethod from_shapes(
- parent_dims,
- out_dim,
- *,
- key,
- width,
- depth=2,
- activation='silu',
- norm=True,
- out_activation=False,
- out_scale=1.0,
- frozen=False,
- symlog_inputs=False,
- init='default',
A randomly-initialized trunk:
depthhidden layers ofwidthunits.widthis required.norm=Trueputs a LayerNorm (eps 1e-3) before each activation.out_scalescales the final layer’s weights and zeroes its bias (0.0starts at the constant zero prediction).initis as in_linear_stack().
- absorb(stats, opt_state, lr=1.0, decay=1.0)[source]#
One optax step from a gradient pytree:
(trunk, opt_state).
- __init__(
- layers,
- norms,
- parent_dims,
- out_dim,
- activation='silu',
- out_activation=False,
- frozen=False,
- symlog_inputs=False,