pyhgf.model.add_constant_state#

pyhgf.model.add_constant_state(network, n_nodes, value_children, volatility_children, node_parameters, coupling_fn)[source]#

Add constant-state (bias) node(s) to a network.

Constant-state nodes hold a fixed mean of 1.0 and precision of 1.0 (fully known bias). They are always wired to their children linearly (coupling_fn is forced to None), have no prediction or update steps, and can only have children, never parents.

Parameters:
  • network (Network) – The neural network to which the node(s) are added.

  • n_nodes (int) – The number of identical node(s) to add.

  • value_children (tuple) – The value children of the node(s), as a tuple of indexes and coupling strengths.

  • volatility_children (tuple) – The volatility children of the node(s), as a tuple of indexes and coupling strengths.

  • node_parameters (dict) – A dictionary of parameters overriding the node defaults.

  • coupling_fn (tuple[Optional[Callable], ...]) – The coupling function(s) between the node(s) and their value children. Forced to None (linear) for constant-state nodes.

Returns:

The updated neural network.

Return type:

network