Skip to content

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
wants to merge 55 commits into
base: main
Choose a base branch
from

Conversation

DevergneTimothee
Copy link

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

  • I am for now using the friction parameter, but it might be worse separating it into two parameters: a prefactor and the atomic masses, for more similarity with the committor method
  • Write documentation and a tutorial, but maybe this can come a bit later?

Questions

  • I did not include anything about the graph integration, so it is not compatible with it for now.
  • Generator name seems a bit generic, and maybe you wanted to use the name for other things

DevergneTimothee and others added 24 commits November 14, 2024 12:46
	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
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.
@EnricoTrizio EnricoTrizio added the enhancement New feature or request label May 29, 2025
Copy link

codecov bot commented May 30, 2025

Codecov Report

Attention: Patch coverage is 91.21813% with 31 lines in your changes missing coverage. Please review.

Project coverage is 92.28%. Comparing base (19345d8) to head (face6f7).
Report is 2 commits behind head on main.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Successfully merging this pull request may close these issues.

2 participants