Skip to content

Commit

Permalink
only test/eval fitting properties
Browse files Browse the repository at this point in the history
During profiling, I found that the virial will be calculated even if I don't provide virial data.
This is meaningless and the the viral has never been outputted.
This commit removes such behavior.
  • Loading branch information
njzjz committed Jan 13, 2022
1 parent d472eeb commit 9a55069
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions deepmd/loss/ener.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,14 @@ def build (self,
return l2_loss, more_loss

def eval(self, sess, feed_dict, natoms):
placeholder = tf.no_op()
run_data = [
self.l2_l,
self.l2_more['l2_ener_loss'],
self.l2_more['l2_force_loss'],
self.l2_more['l2_virial_loss'],
self.l2_more['l2_atom_ener_loss'],
self.l2_more['l2_pref_force_loss']
self.l2_more['l2_ener_loss'] if self.has_e else placeholder,
self.l2_more['l2_force_loss'] if self.has_f else placeholder,
self.l2_more['l2_virial_loss'] if self.has_v else placeholder,
self.l2_more['l2_atom_ener_loss'] if self.has_ae else placeholder,
self.l2_more['l2_pref_force_loss'] if self.has_pf else placeholder,
]
error, error_e, error_f, error_v, error_ae, error_pf = run_sess(sess, run_data, feed_dict=feed_dict)
results = {"natoms": natoms[0], "rmse": np.sqrt(error)}
Expand Down

0 comments on commit 9a55069

Please sign in to comment.