pyhgf.model.insert_nodes#
- pyhgf.model.insert_nodes(network, n_nodes, node_type, node_parameters, value_parents=(None, None), volatility_parents=(None, None), value_children=(None, None), volatility_children=(None, None), coupling_fn=(None,))[source]#
Insert a set of parametrised node in a network.
- Parameters:
network (Network) – The neural network to which the node(s) are added.
n_nodes (int) – The number of identical node(s) to add.
node_type (int) – The integer code of the node type (see
pyhgf.typing.AdjacencyLists).node_parameters (dict) – The dictionary of attributes assigned to each new node.
value_parents (tuple) – The value parents of the node(s), as a tuple of indexes and coupling strengths.
volatility_parents (tuple) – The volatility parents of the node(s), as a tuple of indexes and coupling strengths.
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.
coupling_fn (tuple[Optional[Callable], ...]) – The coupling function(s) between the node(s) and their value children.
Noneimplies linear coupling.
- Returns:
The updated neural network.
- Return type:
network