Commit e8c237d2 authored by Martin Reinecke's avatar Martin Reinecke

cleanup

parent 20f956d8
Pipeline #14897 passed with stage
in 6 minutes and 12 seconds
......@@ -121,18 +121,12 @@ class DescentMinimizer(Loggable, object):
"""
#print "into line search:"
#print " pos: ",energy.position.val[0]
#print " ene: ",energy.value
convergence = 0
f_k_minus_1 = None
step_length = 0
iteration_number = 1
while True:
#print "line search next iteration:"
#print " pos: ",energy.position.val[0]
#print " ene: ",energy.value
if self.callback is not None:
try:
self.callback(energy, iteration_number)
......@@ -153,7 +147,6 @@ class DescentMinimizer(Loggable, object):
# current position is encoded in energy object
descent_direction = self.get_descent_direction(energy)
#print "descent direction:",descent_direction.val[0]
# compute the step length, which minimizes energy.value along the
# search direction
step_length, f_k, new_energy = \
......@@ -161,17 +154,8 @@ class DescentMinimizer(Loggable, object):
energy=energy,
pk=descent_direction,
f_k_minus_1=f_k_minus_1)
#print "out of wolfe:"
#print " old pos: ",energy.position.val[0]
#print " old ene: ",energy.value
#print " new pos: ",new_energy.position.val[0]
#print " new ene: ",new_energy.value
#print " f_k: ",f_k
f_k_minus_1 = energy.value
#print " step length: ", step_length
tx1=energy.position-new_energy.position
#print " step length 2: ", (energy.position-new_energy.position).norm()
#print " step length 3: ", new_energy.position.val[0]-energy.position.val[0]
# check if new energy value is bigger than old energy value
if (new_energy.value - energy.value) > 0:
print "Line search algorithm returned a new energy that was larger than the old one. Stopping."
......
......@@ -229,10 +229,6 @@ class LineSearchStrongWolfe(LineSearch):
The new Energy object on the new position.
"""
#print "entering zoom"
#print alpha_lo, alpha_hi
#print "pos1:",self.line_energy.at(alpha_lo).energy.position.val[0]
#print "pos2:",self.line_energy.at(alpha_hi).energy.position.val[0]
max_iterations = self.max_zoom_iterations
# define the cubic and quadratic interpolant checks
cubic_delta = 0.2 # cubic
......
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