pyjuice.parameterizations.SumParameterization
- class pyjuice.parameterizations.SumParameterization
Base class of the external parameterizations of a sum node.
A SumParameterization describes how per-sample, externally supplied tensors modify the effective parameters of a
ParameterizedSumNodes. It is the sum-node counterpart ofDistributionfor input nodes: the node holds the descriptor, the descriptor owns the semantics (the tensor layout and the math the layer applies), and the compiled circuit groups nodes into layers byget_signature(), so a mode never shares a compiled layer – or a kernel – with a different mode.The descriptor is pure configuration: it holds no tensors and no per-call state. The external tensors are owned by the caller, are not EM-trained by the node, and are supplied per call
lls = pc(x, sum_external_params = {ns: tensors})
with the matching per-sample gradients written back through
pc.backward(x, sum_external_params_grad = {ns: grad_tensors})
They are validated against
tensor_shapes()during the forward pass. The shared parameters keep training through the ordinary EM / gradient path, unchanged.- __init__()