commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Olexiy Movchan (JIRA)" <>
Subject [jira] [Commented] (MATH-1144) LevenbergMarquardtOptimizer does not allow to change current point during optimization
Date Wed, 15 Oct 2014 17:02:36 GMT


Olexiy Movchan commented on MATH-1144:

Hi Gilles,
I have applied and tested your patch. My unit tests failed. Unfortunately the patch is incomplete.

There are 2 conditions in normalization approach:
- point should be normalized before evaluation
- the updated point should be returned to optimizer

Your changes made the normalization explicit now and normalized point is returned inside Evaluation
object. But "currentPoint" vector is not updated in LevenbergMarquardtOptimizer.optimize():

        Evaluation current = problem.evaluate(new ArrayRealVector(currentPoint)); // <=
currentPoint is not updated
        double[] currentResiduals = current.getResiduals().toArray();
        double currentCost = current.getCost();

> LevenbergMarquardtOptimizer does not allow to change current point during optimization
> --------------------------------------------------------------------------------------
>                 Key: MATH-1144
>                 URL:
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.3
>            Reporter: Olexiy Movchan
>              Labels: fitting
>             Fix For: 3.4
>         Attachments:, MATH-1144.patch,,
> It's a regression to commons-math v2.0.
> Our software uses LevenbergMarquardtOptimizer for surface fitting by sampled points.
Our parameterization of the surface we are fitting may be unconstrained, for example it is
enough to have only 4 variables to represent cylinder axis and origin (using euler angles
and origin distance), but to simplify derivative computation we instead use 6 parameter representation
(vector + point). To make sure that the we constrain our search to valid vectors and origins,
we need to renormalize and update surface parameters on every step of optimization.
> Please see this article for details of 3d surface fitting and parameter normalization:
> Attached package with 2 unit tests that reproduce this problem.
> Contents of package:
> 1) simple - simple single file test that tests only in/out side effect of patched library
> 2) full - complex test that fits cylinder using sampled points (uses cylinder, fit, utils
> 3) lib - contains commons-math3 jar libraries: v3.3 and v3.3A1 (patched). There are also
library sources.
> 4) patch - contains SVN patch file
> To reproduce:
> Run and tests with commons-math3-3.3.jar
OR commons-math3-3.3A1.jar libraries.

This message was sent by Atlassian JIRA

View raw message