We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The straight forward TT-decomposition of a full tensor does not work properly for me.
Minimal example:
import tntorch as tn import torch import numpy as np X, Y, Z = np.meshgrid(range(128), range(128), range(128)) full = torch.Tensor( np.sqrt(np.sqrt(X) * (Y + Z) + Y * Z**2) * (X + np.sin(Y) * np.cos(Z)) ) # Some analytical 3D function print(full.shape) t = tn.Tensor(full, ranks_tt=3, requires_grad=True) # You can also pass a list of ranks def metrics(): print(t) print( "Compression ratio: {}/{} = {:g}".format( full.numel(), t.numel(), full.numel() / t.numel() ) ) print("Relative error:", tn.relative_error(full, t)) print("RMSE:", tn.rmse(full, t)) print("R^2:", tn.r_squared(full, t)) metrics()
Output:
torch.Size([128, 128, 128]) 3D TT tensor: 128 128 128 | | | (0) (1) (2) / \ / \ / \ 1 3 3 1 Compression ratio: 2097152/2097152.0 = 1 Relative error: tensor(0.0005, grad_fn=<DivBackward0>) RMSE: tensor(22.0728, grad_fn=<DivBackward0>) R^2: tensor(1.0000, grad_fn=<RsubBackward1>)
The expected output would be the one given in the tutorial. Especially, compression ratio should be $>0$.
I experience this behavior both with python 3.9.6 and 3.12.2 on an M1 MacBook under macOS Sonoma 14.4.1
The text was updated successfully, but these errors were encountered:
same problem under ubuntu 22, python 3.9.19
Sorry, something went wrong.
No branches or pull requests
The straight forward TT-decomposition of a full tensor does not work properly for me.
Minimal example:
Output:
The expected output would be the one given in the tutorial.$>0$ .
Especially, compression ratio should be
I experience this behavior both with python 3.9.6 and 3.12.2 on an M1 MacBook under macOS Sonoma 14.4.1
The text was updated successfully, but these errors were encountered: