TuckerTensorTrain.probe_ambient_transpose#
- static t3toolbox.tucker_tensor_train.TuckerTensorTrain.probe_ambient_transpose(ztildes, ww, sum_over_probes=False)#
def probe_ambient_transpose( ztildes: Sequence[NDArray], # probe residuals, len=d, elm_shape = W + C + (Ni,) ww: Sequence[NDArray], # probe vectors, len=d, elm_shape = W + (Ni,) sum_over_probes: bool = False, ) -> Sequence[NDArray]: # canonical (CP) factors, len=d, elm_shape = stack + (R, Ni)
Ambient transpose of
probe(): back-project probe residuals into canonical (CP) factors.The probe counterpart of
apply_ambient_transpose()– the literal adjoint ofprobeas a linear map on the full tensor space (one of three probe transposes; full taxonomy indocs/transposes.md).probereturnsdvectors, so the residualztildesisdvectors; the back-projection is the rank-``d`` tensorsum_i (w0 (x) ... (x) ztildes_i (x) ... (x) w_{d-1})(residualztildes_iin sloti, probe vectors elsewhere), returned as CP factors. Frame-free. Realize aTuckerTensorTrainwithfrom_canonical().The other two probe transposes are
probe_corewise_transpose(gradient w.r.t. a frame’s cores, for Adam / L-BFGS) andT3Tangent.probe_transpose(the Riemannian gradient).sum_over_probes=Falsekeeps the probe stackW(aW (+ C)stack of rank-dCPs);TruefoldsWinto the CP rank (one rank-d|W|CP, the ambientJ^T r), cheap as CP.Examples
Adjoint identity
<probe_ambient_transpose(z, ww), x>_F == sum_i <z_i, x.probe(ww)_i>:>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> np.random.seed(0) >>> x = t3.TuckerTensorTrain.randn((10, 11, 12), (5, 6, 4), (1, 2, 3, 1)) >>> ww = (np.random.randn(10), np.random.randn(11), np.random.randn(12)) >>> zt = (np.random.randn(10), np.random.randn(11), np.random.randn(12)) >>> T = t3.TuckerTensorTrain.from_canonical(t3.TuckerTensorTrain.probe_ambient_transpose(zt, ww)) >>> lhs = float(np.sum(T.to_dense() * x.to_dense())) >>> rhs = float(sum(np.sum(z * p) for z, p in zip(zt, x.probe(ww)))) >>> print(bool(abs(lhs - rhs) < 1e-9)) True