We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ff7755f commit 0f9104dCopy full SHA for 0f9104d
src/mattersim/applications/batch_relax.py
@@ -122,7 +122,10 @@ def step_batch(self):
122
123
opt.step()
124
opt.nsteps += 1
125
- if opt.converged() or opt.nsteps >= self.max_n_steps:
+ # Get gradient for convergence check
126
+ # Note: gradient = -forces for the optimizable object
127
+ gradient = opt.optimizable.get_gradient()
128
+ if opt.converged(gradient) or opt.nsteps >= self.max_n_steps:
129
self.is_active_instance[idx] = False
130
self.total_converged += 1
131
if self.total_converged % 100 == 0:
0 commit comments