swh:1:snp:39d5aa88ec19187d5f6c7d91d5a7e02d6ac7c2c2
Tip revision: 241bf7ad2b806f6677a5e23534247f35f3a70f10 authored by rballester on 19 February 2023, 19:35:27 UTC
Exact method for moments
Exact method for moments
Tip revision: 241bf7a
test_interpolation.py
import numpy as np
import tntorch as tn
import torch
torch.set_default_dtype(torch.float64)
def test_als_completion():
I = 8
train_x = torch.arange(I)[:, None].repeat(1, 2)
train_y = torch.ones(I)
t = tn.als_completion(train_x, train_y, ranks_tt=3)
assert tn.relative_error(train_y, t[train_x]) < 1e-5