Adding ML custom force for isotropic CG systems#178
Adding ML custom force for isotropic CG systems#178marjanalbooyeh wants to merge 78 commits intocmelab:mainfrom
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
|
Since we probably don't want to add pytorch as a hard depdency, anywhere we import we should check if it's installed and give an error message if it's not. Maybe it says something like
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #178 +/- ##
==========================================
- Coverage 94.77% 93.40% -1.37%
==========================================
Files 26 29 +3
Lines 1970 2213 +243
==========================================
+ Hits 1867 2067 +200
- Misses 103 146 +43
|
Yeah I agree. I'll add that condition. |
for more information, see https://pre-commit.ci
This pull request focuses on the initial implementation of machine learning models for coarse-graining simulations. The changes include adding new utility functions, creating a custom force class, defining a neural network model, and providing a tutorial notebook.
Changes:
Introduced IsotropicCustomForce in flowermd/library/ml_forces.py to integrate a PyTorch model with the simulation framework.
Defined LennardJonesNeighborModel and its configuration in flowermd/modules/coarse_graining_ML/isotropic_coarse_graining.py for predicting forces based on neighbor distances.
Added functions adjust_periodic_boundary, find_neighbors, and neighbors_dr to flowermd/internal/box_neighbors_utils.py for handling periodic boundary conditions and neighbor calculations.
Added a new Jupyter notebook tutorials/6-flowermd-ML-coarse-graining.ipynb to demonstrate the usage of the pre-trained machine learning model for coarse-graining simulations.
Note: I'll wait for the units PR to be merged before merging this one.