pyhgf.model.hybrid.PCModule#
- class pyhgf.model.hybrid.PCModule[source]#
Base class for all parts in a mixed pipeline.
A part contributes two core responsibilities to a mixed training pipeline:
Declaration: The part object (this class and its subclasses) declares which computations learn and which are frozen, along with their configuration (optimiser, layer sizes, activation functions, etc.).
State management: Each part declares its state structure via
init_state(), which returns the state pytree this part holds (network beliefs, optimiser moments, etc.). Execution is delegated toFusedPipeline.
All subclasses must implement:
__init__(...): Store part configuration (layer sizes, optimiser, etc.)init_state(): Return this part’s state pytree
The executor (
FusedPipeline) callsinit_state()to initialise the part’s state, threads it through forward/backward walks in one compiled JAX program, and writes it back via amerge()closure.Notes
Subclasses that do not define both
__init__andinit_stateraise aTypeErrorat class definition time. SeeDeepNetworkAdapter,EquinoxAdapter,PCSequential, andResidualfor examples.- __init__(*args, **kwargs)#
Methods
__init__(*args, **kwargs)init_state()Initialise and return this part's state pytree.