pyhgf.updates.vectorized.volatile.vectorized_layer_prediction#
- pyhgf.updates.vectorized.volatile.vectorized_layer_prediction(child_state, parent_state, weights, params, time_step, coupling_fn=<PjitFunction of <function tanh>>, parent_has_constant=False, has_volatility_parent=True, is_input_layer=False)[source]#
Predict expected mean/precision for all nodes in a volatile-node layer.
Computes both the value-level (external) and volatility-level (internal) predictions. Two predicted precisions of the value level are stored:
\[\hat{\pi}_a^{(k)} = \left( \frac{1}{\pi_a^{(k-1)}} + \Omega_a^{(k)} \right)^{-1}, \qquad \frac{1}{\tilde{\pi}_a^{(k)}} = \frac{1}{\hat{\pi}_a^{(k)}} + \sum_b \frac{ (t^{(k)} \, \alpha_b \, g'(\hat{\mu}_b))^2 } { \tilde{\pi}_b },\]where \(\hat{\pi}_a\) (
conditional_expected_precision) is the AR-plus-volatility chain precision without parent-uncertainty bleed-through and \(\tilde{\pi}_a\) (expected_precision) adds the first-order Laplace value-coupling contribution from each value parent. The bleed-through term uses the parent’s marginal predicted precision \(\tilde{\pi}_b\) (parent_state.expected_precision), which generalises the artifact’s two-node \(\hat{\pi}_b\) to deep networks by propagating each parent’s full marginal predictive variance. The volatility-coupling correction \(\kappa^2 / (2 \hat{\pi}_{\mathrm{vol}})\) enters \(\Omega_a^{(k)}\) inside the log-volatility exponent.- Parameters:
child_state (LayerState) – Current state of the child layer (being predicted).
parent_state (LayerState) – Current state of the parent layer (predictor).
weights (Array) – Weight matrix connecting child to parent, shape
(n_children, n_parents)or(n_children, n_parents + 1)when the parent layer includes a constant input node.params (LayerParams) – Layer parameters for the child layer.
time_step (float) – Time step \(t^{(k)}\) for the prediction.
coupling_fn (Callable) – Coupling function applied to parent means (default
jax.numpy.tanh()).parent_has_constant (bool) – If True, the parent layer has a constant input node (mean = 1.0) appended to its activations. The last column of weights carries the bias connections; its predicted precision is treated as infinite so it contributes zero to the value-coupling variance.
has_volatility_parent (bool) – If True (default), the layer has an implied internal volatility parent whose state (
mean_vol,precision_vol) is predicted and updated. If False, the volatility level is frozen and onlytonic_volatilitydrives the expected precision for the value level.is_input_layer (bool) – If True, the layer is treated as an observed input/leaf: it does not undergo a Gaussian random walk between observations. The
tonic_volatilitycontribution to the value-level expected precision is skipped,expected_precisionandconditional_expected_precisionare both set to the prior precision, and the effective precision is zeroed — mirroring the continuous-node treatment inpyhgf.updates.prediction.continuous.continuous_node_prediction().
- Returns:
Updated child layer state with predicted means and precisions populated for both the value and volatility levels.
- Return type: