CompPhysVienna / n2p2

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

Training with forces - using only certain atoms #121

Open vsumaria opened 3 years ago

vsumaria commented 3 years ago

The question Can force training be done by choosing only relevant atoms. For example for the case of surface science, we are interested more in the atoms at the surface rather than the atoms in the bulk region (which are kept fixed). Is there any way this can be done?

singraber commented 2 years ago

This is related to #91, but as I understand you would like to have even more fine-grained control over individual atoms. In principle it could be done in a similar way as described in the other issue. But as shown there this involves quite some changes to the source code. I can assist but I don't have the time to do it for you.

Another, simpler approach would be to couple the weight somehow to the number of neighbors (which correlates of course with atoms being at the surface). One could invent a formula which increases the weight as the number of neighbors of an atom decreases. This way it would not be necessary to set the weights manually in the input.data file and less source code changes are required. However, I have not thought about any side-effects this procedure could potentially have.

vsumaria commented 2 years ago

The https://github.com/CompPhysVienna/n2p2/issues/91 and this question have one small difference. I need to add weights to each atom of a given structure in the training according to its neighbors. Can you help me figure out what all changes to the source would that intel?

I was also wondering if a selection_mode can be designed such that we can select not based on the threshold values of randomly selected atoms, but of specific species to emphasize their importance in the loss functions.