pyjuice
PC Creation
Construct a vector of input nodes defined on the same variable and have the same input distribution. |
|
Construct a vector of product nodes given a list of children PCs defined on disjoint sets of variables. |
|
Construct a vector of sum nodes given a list of children PCs defined on the same sets of variables. |
|
Context-manager that sets the block size of PC nodes constructed by inputs, multiply, and summate. |
|
Context-manager that controls the assertions of circuit structural properties, including smoothness and decomposability. |
PC Structure Transformation
Merge nodes with identical region node together. |
|
Generate an equivalent PC with potentially high block sizes. |
|
Decrease the block size of a PC. |
|
Create a deepcopy of the input PC. |
Grow a PC by creating duplicates of all nodes (except for the root node). |
|
Prune sum-edge connections from a PC based on per-edge scores, returning a new, sparser PC. |
|
Return a copy of a node group whose block size is increased to block_size (which must be a multiple of the current block size and divide the number of nodes), re-packing its parameters and edges accordingly. |
PC Compilation
Compile a PC represented by a DAG into an equivalent torch.nn.Module. |
IO
Load a PC from file. |
|
Save a PC to file. |