Class Sym
java.lang.Object
org.ddogleg.chainrule.sym.Sym
One node of a symbolic expression that SymGraphBuilder compiles onto a chain graph. An
interior node wraps an operator with its inputs bound by index; a terminal names a value that
arrives from outside the graph.
Terminal kinds and their contract:
input(String, int): per-observation value the caller updates inside its loop. Never differentiated.setting(String): known per-dataset value the caller updates between datasets. Never differentiated.param(String, int): a slice of the parameter array. The only kind that will receive a Jacobian column.constant(double...): fixed values.
Only what a param supplies, or what flows through operators, is ever differentiated: a
terminal without a column mapping is structurally constant, no flag involved.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionWhich expression feeds each input slot, by the operator's own input index@Nullable SymExtensionSet when the node needs hooks of its own, e.g.final Sym.Kindfinal StringLabel for build errors and the wiring dump, not used for lookupfinal @Nullable CROperatorBackwardsJac<double[]> The operator an interior node wraps, one instance per nodefinal intNumber of values a terminal supplies.final double @Nullable []Values of aconstant(double...)terminal -
Method Summary
Modifier and TypeMethodDescriptionstatic Symconstant(double... values) Binds input slotindexof this node's operator, using the operator's own input indexes.static SymPer-observation value, updated by the caller inside its loopstatic Symof(CROperatorBackwardsJac<double[]> op) Interior node wrapping the operator.static SymA slice of the parameter array, the only terminal that is differentiated.static SymKnown per-dataset scalar, updated by the caller between datasets
-
Field Details
-
kind
-
name
Label for build errors and the wiring dump, not used for lookup -
size
public final int sizeNumber of values a terminal supplies. Interior nodes get their size from the operator -
op
The operator an interior node wraps, one instance per node -
bound
-
values
public final double @Nullable [] valuesValues of aconstant(double...)terminal -
extension
Set when the node needs hooks of its own, e.g. a composite choosing parameters per evaluation. The builder installs it and otherwise knows nothing about what it does
-
-
Method Details
-
of
Interior node wrapping the operator. Bind its inputs within(int, Sym); slots left unbound must be terminals the caller feeds, and the builder rejects anything else -
input
-
setting
-
param
A slice of the parameter array, the only terminal that is differentiated.
Keep
sizeto what one evaluation actually touches and re-bind the feed offset per item (per view, per frame): the backwards pass carries a dense matrix as wide as the node, so a param spanning a whole block turns a diagonal dependency into width-squared work -
constant
-
in
-
in0
-
in1
-
in2
-
in3
-
in4
-
in5
-
in6
-
in7
-
in8
-