tltorch.factorized_tensors.init.cp_init

tltorch.factorized_tensors.init.cp_init(cp_tensor, std=0.02)[source]

Initializes directly the weights and factors of a CP decomposition so the reconstruction has the specified std and 0 mean

Parameters:
cp_tensorCPTensor
stdfloat, default is 0.02

the desired standard deviation of the full (reconstructed) tensor

Notes

We assume the given (weights, factors) form a correct CP decomposition, no checks are done here.