funsim / moola

GNU Lesser General Public License v3.0
20 stars 6 forks source link

NewtonCG solver defect #7

Closed jorgensd closed 6 years ago

jorgensd commented 6 years ago

Running pyadjoint examples/poisson-mother/poisson-mother.py produces:

Traceback (most recent call last):
  File "poisson-mother.py", line 186, in <module>
    sol = solver.solve()
  File "/usr/local/lib/python3.5/dist-packages/pyadjoint/tape.py", line 41, in wrapper
    return function(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/moola/algorithms/newton_cg.py", line 158, in solve
    x, a = self.do_linesearch(objective, x, d)
  File "/usr/local/lib/python3.5/dist-packages/moola/algorithms/optimisation_algorithm.py", line 90, in do_linesearch
    alpha = self.linesearch.search(phi, phi_dphi, phi_dphi0)
  File "/usr/local/lib/python3.5/dist-packages/moola/linesearch/strong_wolfe.py", line 97, in search
    raise RuntimeError(task)
RuntimeError: Error: initial g >= 0 (2.452313e-13)

with the Newton CG solver.

sebastkm commented 6 years ago

Testing reveals that this bug was introduced in commit dd22af8

funsim commented 6 years ago

Does this mean that this now fixed?

sebastkm commented 6 years ago

Yes