pyhgf.utils.beliefs_propagation#

pyhgf.utils.beliefs_propagation(attributes: Dict[int, Dict], input_data: Array | ndarray | bool_ | number | bool | int | float | complex, update_sequence: Tuple[Tuple[int, Callable], ...], structure: Tuple[Inputs, Tuple[AdjacencyLists, ...]]) Tuple[Dict, Dict][source]#

Update the network’s parameters after observing new data point(s).

This function performs the beliefs propagation step at a time t triggered by the observation of a new batch of value(s). The way beliefs propagate is defined by the update_sequence and the edges. A tuple of two new parameter_structure is then returned (the carryover and the accumulated in the context of jax.lax.scan()).

Parameters:
attributes

The dictionaries of nodes’ parameters. This variable is updated and returned after the beliefs propagation step.

input_data

An array containing the new observation(s) as well as the time steps. The new observations can be a single value or a vector of observation with a length matching the length inputs.idx. inputs.idx is used to index the ith value in the vector to the ith input node, so the ordering of the input array matters. The time steps are the last column of the array, the default is unit incrementation.

update_sequence

The sequence of updates that will be applied to the node structure.

structure

Information on the network’s structure, including input types and edges.

Returns:
attributes, attributes

A tuple of parameters structure (carryover and accumulated).