pyhgf.utils.get_update_sequence#

pyhgf.utils.get_update_sequence(network: Network, update_type: str) List[source]#

Generate an update sequence from the network’s structure.

This function return an optimized update sequence considering the edges of the network. The function ensures that the following principles apply: 1. all children have computed prediction errors before the parent is updated. 2. all children have been updated before the parent compute the prediction errors. 3. the update function of an input node is chosen based on the node’s type (“continuous”, “binary” or “categorical”). 4. the update function of the parent of an input node is chosen based on the node’s type (“continuous”, “binary” or “categorical”).

Parameters:
network

A neural network, instance of pyhgf.model.network.Network.

update_type

The type of update to perform for volatility coupling. Can be “eHGF” (defaults) or “standard”. The eHGF update step was proposed as an alternative to the original definition in that it starts by updating the mean and then the precision of the parent node, which generally reduces the errors associated with impossible parameter space and improves sampling.

Returns:
sequence

The update sequence generated from the node structure.