commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luc Maisonobe <>
Subject Re: [math] No User Guide for new Optimization methods
Date Mon, 27 Jul 2015 19:58:00 GMT
Hi Nigel,

Le 24/07/2015 21:14, Nigel R Murray a écrit :
> For those of us who have projects dependent on the deprecated Optimization
> methods (using Jacobians for differentiable functions), would someone
> consider updating the User Guide to give optimization examples using the
> new methods?

I have updated the user guide by adding a new chapter dedicated to
least squares (see

The Levenberg-Marquardt optimizer belongs to this section.

I did not yet update the remainder of the optimization documentation,
so it still only refers to the deprecated methods for now.

> Instead of Jacobians, the new methods appear to use DerivativeStructure
> objects.  The current version of the user guide, which is located at
> only describes the deprecated methods.

The specific least squares optimizers to not mandate use of
DerivativeStructure. They can be used to set up the Jacobians, of
course, but they do not appear in the API. It was considered an error
to put this at API level so when least-squares was stabilized (which is
not yet the case for the other optimizers), we went back to a
traditional pair separating value and derivative in the model funtions.

> In the meantime, if some enlightened soul could post a quick migration
> example to this mailing list, that would be awesome.  I'm currently using
> the LevenbergMarquardtOptimizer with
> the DifferentiableMultivariateVectorFunction for the derivative so any
> pointers on how to implement similar functionality using the non-deprecated
> methods would be most helpful.

The API for the least squares should be easy to convert if you start
from the deprecated ones (more simple than starting from the
intermediate API with DerivativeStructure). The main difference is the
introduction of a LeastSquaresProblem interface to hold anything related
to the problem (typically model function, derivatives, start point,
target, ...). The simplest way to create this kind of object is to use
the LeastSquaresBuilder. See the updated userguide in the page
referenced above.

If you already have done some work using DerivativeStructure, you can
still use it (it should simplify getting correct derivatives in
difficult problems), but you will have to extract the values on one
side and the partial derivatives on the other side, using getValue()
and getPartialDerivatives(). If you want some help on this, you can ask
here a more specific questions, I'll try to provide an answer.

best regards,

> I can't be the only one stuck on this issue.
> Thanks!
> Nigel

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message