pyjuice

PC Creation

inputs

Construct a vector of input nodes defined on the same variable and have the same input distribution.

multiply

Construct a vector of product nodes given a list of children PCs defined on disjoint sets of variables.

summate

Construct a vector of sum nodes given a list of children PCs defined on the same sets of variables.

set_block_size

Context-manager that sets the block size of PC nodes constructed by inputs, multiply, and summate.

PC Structure Transformation

merge

Merge nodes with identical region node together.

blockify

Generate an equivalent PC with potentially high block sizes.

unblockify

Decrease the block size of a PC.

deepcopy

Create a deepcopy of the input PC.

PC Compilation

compile

Compile a PC represented by a DAG into an equivalent torch.nn.Module.

IO

load

Load a PC from file.

save

Save a PC to file.