pyhgf.updates.vectorized.volatile.vectorized_layer_posterior_update#
- pyhgf.updates.vectorized.volatile.vectorized_layer_posterior_update(layer, child, weights, coupling_fn, parent_has_constant=False, max_posterior_precision=10000000000.0, child_is_input_layer=False)[source]#
Update the value-level posterior for all nodes in a parent layer.
This is the vectorized equivalent of
pyhgf.updates.posterior.volatile.volatile_node_posterior_update.volatile_node_posterior_update(). It updates the value level precision first, then the mean.- 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)or(n_children, n_parents + 1)when the parent layer includes a constant input node.coupling_fn (Callable) – Coupling function. The first (and second, for the precision update) derivatives are computed inline via
jax.gradin the two helpers.parent_has_constant (bool) – If True, the last column of weights corresponds to the constant input node and is stripped before computing the posterior update.
max_posterior_precision (float) – Upper bound applied to the posterior precision. Default
1e10.child_is_input_layer (bool) – If True, the child is the clamped observation leaf (binary or continuous output). The smoothing correction reduces to the canonical contribution (paper’s Limit 3). Defaults to
False.
- Returns:
Updated parent layer state with posterior mean and precision.
- Return type: