You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Frank Hess (JIRA)" <ji...@apache.org> on 2012/09/19 23:12:07 UTC

[jira] [Created] (MATH-865) Wide bounds to CMAESOptimizer result in NaN parameters passed to fitness function

Frank Hess created MATH-865:
-------------------------------

             Summary: Wide bounds to CMAESOptimizer result in NaN parameters passed to fitness function
                 Key: MATH-865
                 URL: https://issues.apache.org/jira/browse/MATH-865
             Project: Commons Math
          Issue Type: Bug
    Affects Versions: 3.0, 3.1
            Reporter: Frank Hess


If you give large values as lower/upper bounds (for example -Double.MAX_VALUE as a lower bound), the optimizer can call the fitness function with parameters set to NaN.  My guess is this is due to FitnessFunction.encode/decode generating NaN when normalizing/denormalizing parameters.  For example, if the difference between the lower and upper bound is greater than Double.MAX_VALUE, encode could divide infinity by infinity.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (MATH-865) Wide bounds to CMAESOptimizer result in NaN parameters passed to fitness function

Posted by "Frank Hess (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13460905#comment-13460905 ] 

Frank Hess commented on MATH-865:
---------------------------------

Yes, it throws the exception for me now (revision 1388555), thanks.  The secondary issue i mentioned in the comment is still a problem, but I'll open a new bug for that.
                
> Wide bounds to CMAESOptimizer result in NaN parameters passed to fitness function
> ---------------------------------------------------------------------------------
>
>                 Key: MATH-865
>                 URL: https://issues.apache.org/jira/browse/MATH-865
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Frank Hess
>            Assignee: Gilles
>             Fix For: 3.1
>
>         Attachments: Math865Test.java
>
>
> If you give large values as lower/upper bounds (for example -Double.MAX_VALUE as a lower bound), the optimizer can call the fitness function with parameters set to NaN.  My guess is this is due to FitnessFunction.encode/decode generating NaN when normalizing/denormalizing parameters.  For example, if the difference between the lower and upper bound is greater than Double.MAX_VALUE, encode could divide infinity by infinity.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (MATH-865) Wide bounds to CMAESOptimizer result in NaN parameters passed to fitness function

Posted by "Frank Hess (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-865?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frank Hess updated MATH-865:
----------------------------

    Attachment: Math865Test.java

Attached test program that demonstrates the problem.
                
> Wide bounds to CMAESOptimizer result in NaN parameters passed to fitness function
> ---------------------------------------------------------------------------------
>
>                 Key: MATH-865
>                 URL: https://issues.apache.org/jira/browse/MATH-865
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0, 3.1
>            Reporter: Frank Hess
>         Attachments: Math865Test.java
>
>
> If you give large values as lower/upper bounds (for example -Double.MAX_VALUE as a lower bound), the optimizer can call the fitness function with parameters set to NaN.  My guess is this is due to FitnessFunction.encode/decode generating NaN when normalizing/denormalizing parameters.  For example, if the difference between the lower and upper bound is greater than Double.MAX_VALUE, encode could divide infinity by infinity.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (MATH-865) Wide bounds to CMAESOptimizer result in NaN parameters passed to fitness function

Posted by "Gilles (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-865?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gilles updated MATH-865:
------------------------

    Affects Version/s:     (was: 3.1)
        Fix Version/s: 3.1
    
> Wide bounds to CMAESOptimizer result in NaN parameters passed to fitness function
> ---------------------------------------------------------------------------------
>
>                 Key: MATH-865
>                 URL: https://issues.apache.org/jira/browse/MATH-865
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Frank Hess
>             Fix For: 3.1
>
>         Attachments: Math865Test.java
>
>
> If you give large values as lower/upper bounds (for example -Double.MAX_VALUE as a lower bound), the optimizer can call the fitness function with parameters set to NaN.  My guess is this is due to FitnessFunction.encode/decode generating NaN when normalizing/denormalizing parameters.  For example, if the difference between the lower and upper bound is greater than Double.MAX_VALUE, encode could divide infinity by infinity.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (MATH-865) Wide bounds to CMAESOptimizer result in NaN parameters passed to fitness function

Posted by "Gilles (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13460560#comment-13460560 ] 

Gilles commented on MATH-865:
-----------------------------

bq. My guess is this is due to FitnessFunction.encode [...] generating NaN

Good guess.

I've introduced a check on the bounds that now throws an exception in case of overflow.
Please test revision 1388552.

Thanks for the report.

                
> Wide bounds to CMAESOptimizer result in NaN parameters passed to fitness function
> ---------------------------------------------------------------------------------
>
>                 Key: MATH-865
>                 URL: https://issues.apache.org/jira/browse/MATH-865
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0, 3.1
>            Reporter: Frank Hess
>         Attachments: Math865Test.java
>
>
> If you give large values as lower/upper bounds (for example -Double.MAX_VALUE as a lower bound), the optimizer can call the fitness function with parameters set to NaN.  My guess is this is due to FitnessFunction.encode/decode generating NaN when normalizing/denormalizing parameters.  For example, if the difference between the lower and upper bound is greater than Double.MAX_VALUE, encode could divide infinity by infinity.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (MATH-865) Wide bounds to CMAESOptimizer result in NaN parameters passed to fitness function

Posted by "Gilles (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13466351#comment-13466351 ] 

Gilles commented on MATH-865:
-----------------------------

This issue is superseded by MATH-867 whose fix entails that an overflow cannot happen anymore.

                
> Wide bounds to CMAESOptimizer result in NaN parameters passed to fitness function
> ---------------------------------------------------------------------------------
>
>                 Key: MATH-865
>                 URL: https://issues.apache.org/jira/browse/MATH-865
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Frank Hess
>            Assignee: Gilles
>             Fix For: 3.1
>
>         Attachments: Math865Test.java
>
>
> If you give large values as lower/upper bounds (for example -Double.MAX_VALUE as a lower bound), the optimizer can call the fitness function with parameters set to NaN.  My guess is this is due to FitnessFunction.encode/decode generating NaN when normalizing/denormalizing parameters.  For example, if the difference between the lower and upper bound is greater than Double.MAX_VALUE, encode could divide infinity by infinity.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (MATH-865) Wide bounds to CMAESOptimizer result in NaN parameters passed to fitness function

Posted by "Frank Hess (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13459176#comment-13459176 ] 

Frank Hess commented on MATH-865:
---------------------------------

Another issue is, if you use bounds then the bounded range is mapped onto the interval [0,1] where the fit is performed, and then blown back up to your specified bounds after getting a result.  This means if you use a large range, the discreteness of Double variables becomes very noticeable in the fit results.  For example, if you set the boundsMagnitude to 5e15 (approx. 1./Math.ulp(1.)) in the Math865Test program I attached, the fitter is unable to fit anything to a precision smaller than 1.
                
> Wide bounds to CMAESOptimizer result in NaN parameters passed to fitness function
> ---------------------------------------------------------------------------------
>
>                 Key: MATH-865
>                 URL: https://issues.apache.org/jira/browse/MATH-865
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0, 3.1
>            Reporter: Frank Hess
>         Attachments: Math865Test.java
>
>
> If you give large values as lower/upper bounds (for example -Double.MAX_VALUE as a lower bound), the optimizer can call the fitness function with parameters set to NaN.  My guess is this is due to FitnessFunction.encode/decode generating NaN when normalizing/denormalizing parameters.  For example, if the difference between the lower and upper bound is greater than Double.MAX_VALUE, encode could divide infinity by infinity.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (MATH-865) Wide bounds to CMAESOptimizer result in NaN parameters passed to fitness function

Posted by "Gilles (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-865?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gilles resolved MATH-865.
-------------------------

    Resolution: Fixed
    
> Wide bounds to CMAESOptimizer result in NaN parameters passed to fitness function
> ---------------------------------------------------------------------------------
>
>                 Key: MATH-865
>                 URL: https://issues.apache.org/jira/browse/MATH-865
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Frank Hess
>            Assignee: Gilles
>             Fix For: 3.1
>
>         Attachments: Math865Test.java
>
>
> If you give large values as lower/upper bounds (for example -Double.MAX_VALUE as a lower bound), the optimizer can call the fitness function with parameters set to NaN.  My guess is this is due to FitnessFunction.encode/decode generating NaN when normalizing/denormalizing parameters.  For example, if the difference between the lower and upper bound is greater than Double.MAX_VALUE, encode could divide infinity by infinity.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (MATH-865) Wide bounds to CMAESOptimizer result in NaN parameters passed to fitness function

Posted by "Gilles (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-865?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gilles updated MATH-865:
------------------------

    Assignee: Gilles
    
> Wide bounds to CMAESOptimizer result in NaN parameters passed to fitness function
> ---------------------------------------------------------------------------------
>
>                 Key: MATH-865
>                 URL: https://issues.apache.org/jira/browse/MATH-865
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Frank Hess
>            Assignee: Gilles
>             Fix For: 3.1
>
>         Attachments: Math865Test.java
>
>
> If you give large values as lower/upper bounds (for example -Double.MAX_VALUE as a lower bound), the optimizer can call the fitness function with parameters set to NaN.  My guess is this is due to FitnessFunction.encode/decode generating NaN when normalizing/denormalizing parameters.  For example, if the difference between the lower and upper bound is greater than Double.MAX_VALUE, encode could divide infinity by infinity.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (MATH-865) Wide bounds to CMAESOptimizer result in NaN parameters passed to fitness function

Posted by "Frank Hess (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13459118#comment-13459118 ] 

Frank Hess commented on MATH-865:
---------------------------------

Also, if the first call to the fitness function returns NaN and gets stored in the bestValue local variable in doOptimize() before the generationLoop, then the optimization will completely fail.  This is because the later comparison if(bestValue > bestFitness) will always return false if bestValue is NaN and no more optimal result will ever be found.
                
> Wide bounds to CMAESOptimizer result in NaN parameters passed to fitness function
> ---------------------------------------------------------------------------------
>
>                 Key: MATH-865
>                 URL: https://issues.apache.org/jira/browse/MATH-865
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0, 3.1
>            Reporter: Frank Hess
>
> If you give large values as lower/upper bounds (for example -Double.MAX_VALUE as a lower bound), the optimizer can call the fitness function with parameters set to NaN.  My guess is this is due to FitnessFunction.encode/decode generating NaN when normalizing/denormalizing parameters.  For example, if the difference between the lower and upper bound is greater than Double.MAX_VALUE, encode could divide infinity by infinity.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira