Skip to content

Commit

Permalink
Merge pull request #327 from amcadmus/master
Browse files Browse the repository at this point in the history
Bug fixings and add notice for the consistency of TF versions.
  • Loading branch information
amcadmus authored Jan 12, 2021
2 parents 15948fa + 2b21c22 commit 4002aa5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion doc/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ source $tensorflow_venv/bin/activate
pip install --upgrade pip
pip install --upgrade tensorflow==2.3.0
```
It is notice that everytime a new shell is started and one wants to use `DeePMD-kit`, the virtual environment should be activated by
It is highly recommanded to keep the consistency of the TensorFlow version for the python and C++ interfaces.
Everytime a new shell is started and one wants to use `DeePMD-kit`, the virtual environment should be activated by
```bash
source $tensorflow_venv/bin/activate
```
Expand Down
10 changes: 5 additions & 5 deletions source/train/Loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ def __init__ (self, jdata, **kwarg) :
self.has_ae = (self.start_pref_ae != 0 or self.limit_pref_ae != 0)
self.has_pf = (self.start_pref_pf != 0 or self.limit_pref_pf != 0)
# data required
add_data_requirement('energy', 1, atomic=False, must=self.has_e, high_prec=True)
add_data_requirement('force', 3, atomic=True, must=self.has_f, high_prec=False)
add_data_requirement('virial', 9, atomic=False, must=self.has_v, high_prec=False)
add_data_requirement('atom_ener', 1, atomic=True, must=self.has_ae, high_prec=False)
add_data_requirement('atom_pref', 1, atomic=True, must=self.has_pf, high_prec=False, repeat=3)
add_data_requirement('energy', 1, atomic=False, must=False, high_prec=True)
add_data_requirement('force', 3, atomic=True, must=False, high_prec=False)
add_data_requirement('virial', 9, atomic=False, must=False, high_prec=False)
add_data_requirement('atom_ener', 1, atomic=True, must=False, high_prec=False)
add_data_requirement('atom_pref', 1, atomic=True, must=False, high_prec=False, repeat=3)

def build (self,
learning_rate,
Expand Down
1 change: 1 addition & 0 deletions source/train/argcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ def loss_args():
doc_loss = 'The definition of loss function. The type of the loss depends on the type of the fitting. For fitting type `ener`, the prefactors before energy, force, virial and atomic energy losses may be provided. For fitting type `dipole`, `polar` and `global_polar`, the loss may be an empty `dict` or unset.'
ca = Argument('loss', dict, [],
[loss_variant_type_args()],
optional = True,
doc = doc_loss)
return ca

Expand Down

0 comments on commit 4002aa5

Please sign in to comment.