Skip to content

Commit da1cb4a

Browse files
committed
Switch order of operation in opt
1 parent ff58947 commit da1cb4a

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

simpeg/optimization.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -497,13 +497,14 @@ def minimize(self, evalFunction: MinimizeCallable, x0: np.ndarray) -> np.ndarray
497497

498498
if np.any(np.isnan(x0)):
499499
raise ValueError("x0 has a nan.")
500-
self.f = evalFunction(
501-
self.xc, return_g=False, return_H=False
502-
) # will stash the fields objects
503-
self.printIter()
500+
# self.f = evalFunction(
501+
# self.xc, return_g=False, return_H=False
502+
# ) # will stash the fields objects
503+
# self.printIter()
504504
while True:
505505
self.doStartIteration()
506506
self.f, self.g, self.H = evalFunction(self.xc, return_g=True, return_H=True)
507+
self.printIter()
507508
if self.stoppingCriteria():
508509
break
509510
self.searchDirection = self.findSearchDirection()
@@ -832,7 +833,6 @@ def doEndIteration(self, xt: np.ndarray) -> None:
832833
# the current iterate, `self.xc`, must be set in this function if overridden in a base class
833834
self.x_last, self.xc = self.xc, xt
834835
self.iter += 1
835-
self.printIter() # before callbacks (from directives...)
836836
if self.debug:
837837
self.printDone()
838838

0 commit comments

Comments
 (0)