pyhgf.utils.sample_node_distribution#

pyhgf.utils.sample_node_distribution(attributes, edges, node_idx, rng_key)[source]#

Sample a value from the distribution of an input node.

Parameters:
  • attributes (dict[int | str, dict]) – The dictionary of node parameters, keyed by node index.

  • edges (tuple[AdjacencyLists, ...]) – Information on the network’s edges.

  • node_idx (int) – The index of the child nodes whose distribution is to be sampled.

  • rng_key (PRNGKey) – A PRNG key for random number generation.

Returns:

The sampled value from the node’s distribution.

Return type:

sample