SR2IntermediateDiff#
Source: models/common/IntermediateDiff.py
Finite difference along an intermediate dimension.
Mirrors C++ IntermediateDiff<SR2>: apply the n-th order finite
difference along the selected sub-batch axis. The selected axis length
shrinks by n; sub_batch_ndim is preserved (this is a per-axis
differencing operator, not a reduction).
The reduces HIT parameter names the sub-batch label of the
differencing axis – the chain rule on that label is structurally
non-diagonal (each output site depends on several input sites
along the label).
Inputs#
from—input·SR2· requiredVariable to reduce
Outputs#
to—output·SR2· requiredThe reduced variable
Other options#
dim—int· requiredIntermediate dimension to take the finite difference
n—int· default1Order of the differentiation
reduces—str· requiredSub-batch label of the differencing axis.