pyhgf.updates.vectorized.volatile.vectorized_posterior_update_mean_value_level#

pyhgf.updates.vectorized.volatile.vectorized_posterior_update_mean_value_level(layer, child, weights, coupling_fn, posterior_precision)[source]#

Update the mean of the value level for all nodes in a layer.

This is the vectorized equivalent of pyhgf.updates.posterior.volatile.posterior_update_value_level.posterior_update_mean_value_level().

Uses the joint-Gaussian (RTS-smoother) gain. Each value child contributes

\[\Delta \mu_b \mathrel{+}= \frac{\kappa \, g'(\hat{\mu}_b) \, g_a} {\pi_b} \, \delta_a, \qquad g_a = \frac{\hat{\pi}_a \, \pi_a}{\hat{\pi}_a + \pi_y}, \qquad \pi_y = \pi_a - \tilde{\pi}_a,\]

where \(\pi_b\) is the just-updated parent posterior precision (posterior_precision); contributions accumulate across children and are divided by \(\pi_b\) once, after summation. For leaves \(\pi_y = 0\) and \(g_a\) collapses to \(\tilde{\pi}_a\), recovering the canonical gain.

Note

Unlike the standard continuous-state posterior updates elsewhere in the toolbox, the volatile-state updates evaluate coupling function derivatives at the expected mean (i.e. the prediction) rather than the posterior mean. This choice is made to better suit deep learning networks where the prediction serves as the natural reference point for computing updates.

Parameters:
  • layer (LayerState) – Current state of the parent layer (being updated).

  • child (LayerState) – Current state of the child layer (providing prediction errors).

  • weights (Array) – Weight matrix connecting child to parent, shape (n_children, n_parents).

  • coupling_fn (Callable) – Coupling function. The first derivative is computed inline via jax.grad.

  • posterior_precision (Array) – Already-updated value-level posterior precision \(\pi_b\) for the parent layer; the precision-weighted PE is divided by this once, after accumulating across children.

Returns:

Posterior mean for each node in the parent layer.

Return type:

jnp.ndarray