CompPhysVienna / n2p2

n2p2 - A Neural Network Potential Package
https://compphysvienna.github.io/n2p2/
GNU General Public License v3.0
223 stars 83 forks source link

Committee-NNP #92

Open singraber opened 3 years ago

singraber commented 3 years ago

Implement committee NNPs (C-NNPs) as presented in J. Chem. Phys. 153, 104105 (2020) in the core library, applications (only prediction, no training) and LAMMPS interface.

Allow two different modes in LAMMPS (and tools where useful):

  1. Validation: committee is used to estimate the error, but only a single NN drives the MD.
  2. Prediction: use committee average in MD simulation (actual method in above publication).

New keywords introduced:

codecov-io commented 3 years ago

Codecov Report

Merging #92 (15a7548) into master (995f0b5) will decrease coverage by 0.17%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #92      +/-   ##
==========================================
- Coverage   71.76%   71.59%   -0.18%     
==========================================
  Files         129      129              
  Lines       13981    14065      +84     
==========================================
+ Hits        10034    10070      +36     
- Misses       3947     3995      +48     
Flag Coverage Δ
cpp 74.28% <ø> (-0.27%) :arrow_down:
python 71.59% <ø> (-0.18%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/libnnp/Atom.cpp 40.54% <ø> (-0.40%) :arrow_down:
src/libnnp/Atom.h 66.66% <ø> (ø)
src/libnnp/Element.h 100.00% <ø> (ø)
src/libnnp/Mode.cpp 74.59% <ø> (-1.28%) :arrow_down:
src/libnnp/Mode.h 66.66% <ø> (ø)
src/libnnp/Settings.cpp 94.22% <ø> (+0.05%) :arrow_up:
src/libnnp/Structure.cpp 76.99% <ø> (-1.54%) :arrow_down:
src/libnnp/Vec3D.h 88.40% <0.00%> (-5.45%) :arrow_down:
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 995f0b5...15a7548. Read the comment docs.

DanielMarchand commented 3 years ago

I would be interested in trying this feature out, especially if it has a lammps interface. How close to working is it?

singraber commented 3 years ago

I did not yet have time to look over the recent changes, I will do this next week. From what I can see the LAMMPS interface is not yet included but the standalone prediction (using nnp-predict) should work. @Kyvala Do you also want to comment on this?

Kyvala commented 3 years ago

I have tested it and it should work. However, it is implemented only for nnp-predict. It should be straightforward to implement even for LAMMPS interface but I am waiting on Andreas's check and finding optimal parameters for my material. Then I will move on to LAMMPS and make it work even for LAMMPS.

codecov-commenter commented 3 years ago

Codecov Report

Merging #92 (0ebd71f) into master (9c350fb) will decrease coverage by 0.48%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #92      +/-   ##
==========================================
- Coverage   72.28%   71.80%   -0.49%     
==========================================
  Files         130      130              
  Lines       14231    14419     +188     
==========================================
+ Hits        10287    10353      +66     
- Misses       3944     4066     +122     
Flag Coverage Δ
cpp 74.42% <ø> (-0.66%) :arrow_down:
python 71.80% <ø> (-0.49%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/application/nnp-comp2.cpp 0.00% <ø> (ø)
src/application/nnp-predict.cpp 82.92% <ø> (-12.59%) :arrow_down:
src/application/nnp-train.cpp 94.28% <ø> (+0.16%) :arrow_up:
src/libnnp/Atom.cpp 40.75% <ø> (-0.20%) :arrow_down:
src/libnnp/Atom.h 66.66% <ø> (ø)
src/libnnp/Element.h 100.00% <ø> (ø)
src/libnnp/Mode.cpp 74.04% <ø> (-1.78%) :arrow_down:
src/libnnp/Mode.h 66.66% <ø> (ø)
src/libnnp/Prediction.cpp 69.46% <ø> (-30.54%) :arrow_down:
src/libnnp/Settings.cpp 94.22% <ø> (+0.05%) :arrow_up:
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9c350fb...0ebd71f. Read the comment docs.

cschran commented 1 year ago

Hi developers,

I've just stumbled upon this PR again and was wondering if there are any plans to merge this with the main branch in the near future. From a quick look at the code, it seems like it's very close to completion.

Many thanks for all your hard work and all the best, Christoph

Kyvala commented 1 year ago

Dear Christoph Schran,

The committee implementation is working and complete for prediction. We are using it. The official merging is not happening soon as there are conflicts and unexpected behavior in the training phase. Those have to be resolved first. However, if you are interested in prediction, you can merge it with the master version by yourself and use it only for prediction. There should not be a critical conflict.

Best regards, Lukas Kyvala

po 28. 11. 2022 v 12:48 odesílatel Christoph Schran < @.***> napsal:

Hi developers,

I've just stumbled upon this PR again and was wondering if there are any plans to merge this with the main branch in the near future. From a quick look at the code, it seems like it's very close to completion.

Many thanks for all your hard work and all the best, Christoph

— Reply to this email directly, view it on GitHub https://github.com/CompPhysVienna/n2p2/pull/92#issuecomment-1328943205, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQ3JUWYNVHDGGC5AOLGZ6PTWKSL2RANCNFSM4YYLTJ7A . You are receiving this because you were mentioned.Message ID: @.***>