Commit 613e2efb authored by Matevz, Sraml (sraml)'s avatar Matevz, Sraml (sraml)

added convergance criterium.

parent d59ba775
Pipeline #13715 failed with stage
in 5 minutes and 37 seconds
......@@ -156,6 +156,16 @@ class DescentMinimizer(Loggable, object):
pk=descend_direction,
f_k_minus_1=f_k_minus_1)
f_k_minus_1 = energy.value
# check if new energy value is bigger than old energy value
if (new_energy.value - energy.value) > 0:
self.logger.info("Line search algorithm was unsuccessful. "
"Stopping.")
new_energy = energy.at( position=energy.position +
np.random.rand()/10*(new_energy.position-energy.position) )
energy = new_energy
break
energy = new_energy
# check convergence
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment