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

detach inverse in the VAMPE score #274

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

DanielWicz
Copy link

In the original paper, it is stated:

"Another advantage of the VAMP-E based validation score is that it does not involve any inverse
operation of matrices and can be stably computed."

It seems in general, that the sym_inverse should be detached from the graph, otherwise it is involved in the computational graph and gradient is calculated through the inverse. In fact, from my point of view, both inverses and koopman should be detached from the graph, and only the torch.trace part should be contributing to the optimization.

@codecov
Copy link

codecov bot commented May 11, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (9a53285) 92.15% compared to head (0bb3215) 92.16%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #274   +/-   ##
=======================================
  Coverage   92.15%   92.16%           
=======================================
  Files         142      142           
  Lines       11652    11652           
=======================================
+ Hits        10738    10739    +1     
+ Misses        914      913    -1     
Impacted Files Coverage Δ
deeptime/decomposition/deep/_vampnet.py 94.73% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@DanielWicz DanielWicz changed the title detach invers in VAMPE score detach inverse in the VAMPE score May 12, 2023
@clonker
Copy link
Member

clonker commented May 14, 2023

Hi! Thank you very much for your contributions :) please correct me if I'm wrong but I think we'd still need the gradient flow through these components - while the score doesn't directly involve any inverses, we still have to transform our data into whitened space (C^{-1/2}). Have you tried/compared training with your modification to the reference?

Thanks!

@DanielWicz
Copy link
Author

At the moment I have tested in my own implementation in Tensorflow 2. I have noticed that it lead to faster training and faster reduction of the loss. Therefore I have decided to open this Pull request. I will try to make more controlled tests with deeptime.

Do you use some particular dataset for comparison, for example like WLALL pentapeptide from PYEMMA ?

@clonker
Copy link
Member

clonker commented May 16, 2023

Super cool! Pentapeptide would be amazing, otherwise you could also test it out on ala2: https://deeptime-ml.github.io/latest/notebooks/examples/ala2-example.html

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.

2 participants