pyhgf.model.builder.LayerConfig#
- class pyhgf.model.builder.LayerConfig(size, kind='volatile', add_constant_input=True, fully_connected=True, coupling_fn=None, volatility_parent=True, tonic_volatility=None, tonic_volatility_vol=None)[source]#
Configuration for one layer in a DeepNetwork.
Encapsulates all per-layer settings so they can be serialised to/from JSON, YAML, or other formats. Each field corresponds to a parameter of
DeepNetwork.add_layer().- Parameters:
- fully_connected#
Whether the layer is fully connected (dense) or one-to-one.
- Type:
bool, default True
- coupling_fn#
Name of coupling function (“identity”, “gelu”, “relu”, etc.) or None to use the network-level default. Must be a name that can be resolved via
resolve_coupling_fn().- Type:
Optional[str], default None
- tonic_volatility#
Per-layer override for the value level’s tonic volatility. Only valid when the network is built with
tonic_volatility=True, which is what allocates the parameter.- Type:
Optional[float], default None
- tonic_volatility_vol#
Per-layer override for tonic_volatility_vol parameter.
- Type:
Optional[float], default None
Notes
String coupling function names (e.g., “gelu”, “relu”) are resolved at network build time. Use None to inherit the network-level coupling function.
- __init__(size, kind='volatile', add_constant_input=True, fully_connected=True, coupling_fn=None, volatility_parent=True, tonic_volatility=None, tonic_volatility_vol=None)#
Methods
__init__(size[, kind, add_constant_input, ...])from_dict(data)Construct from a dictionary.
to_dict()Convert to a JSON-serialisable dictionary.
Attributes