UT3Tangent.probe_derivatives_transpose#

static t3toolbox.uniform_manifold.UT3Tangent.probe_derivatives_transpose(ztildes, ww, pp, frame, order, sum_over_probes=False, chunk_size=100)#
def probe_derivatives_transpose(
        ztildes,                   # probe residual jets, len=d, ith elm_shape=(order+1,)+W+K+C+(Ni,)
        ww,                        # probe vectors,   len=d, ith elm_shape=W+(Ni,)
        pp,                        # perturbation P,  len=d, ith elm_shape=W+(Ni,)
        frame:  ubv.UT3Frame,      # the orthogonal frame the tangent attaches at
        order:  int,               # highest derivative order
        sum_over_probes:  bool = False,
        chunk_size=100,            # W-chunk size for the gradient assembly; None -> dense. docs/chunking.md
) -> 'UT3Tangent':  # tangent stack W+K (sum_over_probes=False) or K (True); frame stack C

Transpose 𝒥ᵀ of probe_derivatives(): back-project residual jets into a UT3Tangent at frame. The residual jets live in the forward derivative-probe space ((order+1)+W+K+C+(Ni,)); the transpose sums the order axis, so the result is a single tangent (no order axis). The tangent batch K rides through, sum_over_probes sums (True, Gauss-Newton 𝒥ᵀr) or keeps (False) the sample stack W. Bare 𝒥ᵀ. Uniform mirror of probe_derivatives_transpose().

Examples

The adjoint identity <r, 𝒥v> = <𝒥ᵀr, v> per order (the measurement dot sums the order axis too):

>>> import numpy as np
>>> import t3toolbox.tucker_tensor_train as t3
>>> import t3toolbox.uniform_tucker_tensor_train as ut3
>>> import t3toolbox.uniform_manifold as ut3m
>>> np.random.seed(0)
>>> x = ut3.UniformTuckerTensorTrain.from_t3(t3.TuckerTensorTrain.randn((10, 11, 12), (5, 6, 4), (1, 2, 3, 1)))
>>> v = ut3m.UNIFORM_COREWISE.randn(ut3m.UNIFORM_MANIFOLD.frame(x))
>>> ww = (np.random.randn(10), np.random.randn(11), np.random.randn(12))
>>> pp = (np.random.randn(10), np.random.randn(11), np.random.randn(12))
>>> Jv = v.probe_derivatives(ww, pp, 2)
>>> r = [np.random.randn(*np.asarray(z).shape) for z in Jv]
>>> JTr = ut3m.UT3Tangent.probe_derivatives_transpose(r, ww, pp, v.frame, 2, sum_over_probes=True)
>>> lhs = sum(float(np.sum(ri * np.asarray(zi))) for ri, zi in zip(r, Jv))
>>> print(bool(abs(lhs - float(JTr.corewise_inner(v))) < 1e-9))
True
Parameters:
  • frame (UT3Frame)

  • order (int)

  • sum_over_probes (bool)

Return type:

UT3Tangent