Skip to content
New issue

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

[WIP] A bunch of updates to allow for negative-valued tensor trains and improve robustness against under/over flow #36

Merged
merged 15 commits into from
May 30, 2024

Conversation

stecrotti
Copy link
Owner

@stecrotti stecrotti commented May 14, 2024

I'm #32, but stronger.

This normalizes intermediate results of orthonormalize_right!, orthonormalize_left to prevent numerical issues.
Plus, it incorporates a "normalization" constant z directly in the tensor train object. Pseudo-code summary:

struct TensorTrain
   tensors
   z
end

evaluate(A::TensorTrain, x) = tr(prod(AA(xx) for (AA,xx) in zip(A,x))) / A.z
normalization(A::TensorTrain) = (l, z = accumulate_L(A); z / A.z)

Any operation which, in order to prevent numerical issues, needs to re-scale the tensors, must update A.z accordingly.
At the same time, any function which computes properties (evaluate, normalization, etc) must take into account the value of A.z

Fixes #31 #34 #35

Copy link

codecov bot commented May 14, 2024

Codecov Report

Attention: Patch coverage is 99.15254% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 96.01%. Comparing base (7fe8f80) to head (820a7ad).
Report is 2 commits behind head on main.

Files Patch % Lines
src/utils.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #36      +/-   ##
==========================================
+ Coverage   95.13%   96.01%   +0.87%     
==========================================
  Files           6        6              
  Lines         329      376      +47     
==========================================
+ Hits          313      361      +48     
+ Misses         16       15       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Numerical under/over flow when normalizing
1 participant