We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0897d1f commit 891a4e9Copy full SHA for 891a4e9
1 file changed
emle/calculator.py
@@ -1327,12 +1327,15 @@ def _calculate_energy_and_gradients(
1327
_logger.error(msg)
1328
raise RuntimeError(msg)
1329
1330
- if (self._qbc_deviation):
+ if self._qbc_deviation:
1331
E_std = _torch.std(base_model._E_vac_qbc).item()
1332
max_f_std = _torch.max(_torch.std(base_model._grads_qbc, axis=0)).item()
1333
with open(self._qbc_deviation, "a") as f:
1334
f.write(f"{E_std:12.5f}{max_f_std:12.5f}\n")
1335
- if self._qbc_deviation_threshold and max_f_std > self._qbc_deviation_threshold:
+ if (
1336
+ self._qbc_deviation_threshold
1337
+ and max_f_std > self._qbc_deviation_threshold
1338
+ ):
1339
msg = "Force deviation threshold reached!"
1340
raise ValueError(msg)
1341
0 commit comments