dolfin-adjoint / pyadjoint

The algorithmic differentation tool pyadjoint and add-ons.
GNU Lesser General Public License v3.0
90 stars 35 forks source link

`derivative_options` argument to `minimize` is likely incorrect #153

Open jrmaddison opened 2 months ago

jrmaddison commented 2 months ago

e.g. for SciPy's L-BFGS-B using a (non $l^2$) Riesz map will lead to the derivative being supplied to the optimizer being inconsistent. SciPy requires the (non-mapped) derivative.

Ig-dolci commented 2 months ago

Yes, I agree. This was the key reasons I considered adding the derivative option to the minimize. The default Riesz representation in Firedrake is L2, and without the PR 151, we were not able to use SciPy's minimisation with l2 riesz representation because there was no way to set it. I am just thinking why the test is working with scipy using L2.

jrmaddison commented 2 months ago

minimize could access the adjoint variable directly, i.e. use derivative to run the adjoint, but then ignore it's return value and access the Control.block_variable.adj_value directly. That would still cost an extra mass matrix solve but would work without needing to know Firedrake-specific Riesz map parameters.