pyjuice.nodes.InputNodes

class pyjuice.nodes.InputNodes(num_node_blocks: int, scope: Sequence | BitSet, dist: Distribution, params: torch.Tensor | None = None, block_size: int = 0, _no_set_meta_params: bool = False, **kwargs)

A class representing vectors of input nodes. It is created by pyjuice.inputs.

Parameters:
  • num_node_blocks (int) – number of node blocks

  • scope (Union[Sequence,BitSet]) – variable scope (set of variables)

  • dist (Distribution) – input distribution

  • params (Optional[Tensor]) – parameters of the vector of nodes

  • block_size (int) – block size

__init__(num_node_blocks: int, scope: Sequence | BitSet, dist: Distribution, params: torch.Tensor | None = None, block_size: int = 0, _no_set_meta_params: bool = False, **kwargs) None

Methods

duplicate([scope, tie_params])

Create a duplication of the current node with the same specification (i.e., number of nodes, block size, distribution).

get_params()

Get the input node parameters.

init_parameters([perturbation, recursive, ...])

Randomly initialize node parameters.

num_parameters([count_input_params, recursive])

set_meta_params(**kwargs)

Set the meta-parameters such as the mask of input nodes with the MaskedCategorical distribution.

set_params(params[, normalize])

Set the input node parameters.