-
Notifications
You must be signed in to change notification settings - Fork 31
Integration of the infinitesimal generator in mlcolvar #178
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
Open
DevergneTimothee
wants to merge
55
commits into
luigibonati:main
Choose a base branch
from
DevergneTimothee:generator_PR
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,775
−48
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
added generator loss : mlcolvar/core/loss/generator_loss.py added generator class: mlcolvar/cvs/generator/__init__.py added generator class: mlcolvar/cvs/generator/generator.py
…ss.py Separate computation of descriptors: mlcolvar/cvs/generator/generator.py
added single NN generator: mlcolvar/cvs/__init__.py added single NN generator: mlcolvar/cvs/generator/__init__.py added single NN generator: mlcolvar/cvs/generator/generator.py
…var/core/loss/generator_loss.py added some starts for documentation and removed useless stuff: mlcolvar/cvs/generator/generator.py
Added forecast_occupation_number function
…r/DevergneTimothee/178
Comment on lines
+434
to
+447
# if not hasattr(self, "out_ind"): | ||
# with torch.no_grad(): | ||
# # we create a big index vector repeated for the different outputs | ||
# self.out_ind = self.scatter_indeces.unsqueeze(0).repeat((x.shape[-1], 1)) | ||
|
||
# # get and apply shifts | ||
# aux = (torch.arange(x.shape[-1], device=x.device)*(self.batch_size*self.n_atoms*3)).unsqueeze(-1) | ||
# self.out_ind = self.out_ind + aux | ||
|
||
# # flatten the indeces and to be sure move to device | ||
# self.out_ind = self.out_ind.ravel() | ||
# self.out_ind = self.out_ind.to(x.device) | ||
|
||
# # create output tensor to make it faster |
Check notice
Code scanning / CodeQL
Commented-out code Note
This comment appears to contain commented-out code.
Codecov ReportAttention: Patch coverage is
🚀 New features to boost your workflow:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Integration of the infinitesimal generator method in mlcolvar. A cv is implemented in mlcolvar/cvs/generator and the utils and the loss function are in mlcolvar/core/loss/generator_loss.py.
The Generator cv takes as arguments layers, eta (the shift for the resolvant), r (the number of eigenfunctions we want to compute), alpha (the strength og the orthonormality regularization), friction (the Langevin friction) and the cell if needed.
Once trained, one can use the method compute_eigenfunctions by passing as argument a dataset to compute the eigenfunctions based on the trained model.
Todos
Questions