pyhgf.updates.vectorized.volatile.vectorized_layer_posterior_update#
- pyhgf.updates.vectorized.volatile.vectorized_layer_posterior_update(layer, child, weights, coupling_fn_grad, parent_has_constant=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_grad (Callable) – Gradient of the coupling function.
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.
- Returns:
Updated parent layer state with posterior mean and precision.
- Return type:
LayerState