mailRe: [bug #6503] Uncaught nan in xh_vect


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Edward d'Auvergne on August 02, 2006 - 14:59:
This bug (http://gna.org/bugs/?func=detailitem&item_id=6503) could be
a tough one, especially locating it within the minimisation code.
Though it would be worthwhile to track down to prevent future issues.
Don't forget that all the code within the 'minimise/' directory will
eventually be split out into it's own software project (to become a
relax dependency) - hence catching this would be useful to more than
just relax users.

I have a feeling that the problem may be in the line search as all the
other algorithms - Augmented Lagrangian constraint algorithm (also
known as the Method of Multipliers) and Newton line search - have
iteration limits.  The sub loop of the Method of Multipliers is
limited to 500.  The upper limit in total is 1e7 although the
constraint algorithm causes this to terminate a little early.  A
number of easy tests may pin-point the issue - turning constraints off
"constraints=0", changing the line search algorithm ("More-Thuente" is
a good one), changing the Hessian modification ("Chol" the cholesky
modification may work), or changing to a non line search algorithm
("fr" Fletcher-Reeves conjugate gradient or "dogleg" trust-region
algorithms for example).  Another option is to increase the printed
output by increasing the "print_flag" flag value to 2, 3, etc.  These
simple tests should hopefully pin-point the exact cause of the
minimisation issue.

Also, which version of Python are you using?  It could be an issue
with how Python handles the value of NaN.  The first catch should be
easy although by definition NaN != NaN.  I don't know if Python does
this properly so it might be worth avoiding the NaN value to start
with.  As for the minimisation issue, it might be worth having a
separate report for it.

Edward



On 8/2/06, Chris MacRaild <NO-REPLY.INVALID-ADDRESS@xxxxxxx> wrote:

URL: <http://gna.org/bugs/?func=detailitem&item_id=6503>

                 Summary: Uncaught nan in xh_vect
                 Project: relax
            Submitted by: macraild
            Submitted on: Wednesday 08/02/2006 at 10:49
                Category: None
                Priority: 5 - Normal
                Severity: 2 - Minor
                  Status: None
                 Privacy: Public
             Assigned to: macraild
         Originator Name:
        Originator Email:
             Open/Closed: Open
                 Release: Repository: 1.2 line
        Operating System: None

    _______________________________________________________

Details:

Through a typo in my script, I created a state in which the het nucleus and
the proton were set to the same atom. This error was not caught, and xh_vect
was set to array([nan, nan, nan])
Obviously, this caused problems, but again the errors were not caught:

Grid searches failed with:

     Unconstrained grid search size: 11 (constraints may decrease this
size).


Grid search ~~~~~~~~~~~

     Searching the grid.

     Parameter values: array([ 0.])
     Function value:   1.0000000000000001e+300
     Iterations:       11
     Function calls:   11
     Gradient calls:   0
     Hessian calls:    0
     Warning:          None



and then minimisation gets to:

     Method of Multipliers
     ~~~~~~~~~~~~~~~~~~~~~

     k: 0       xk: array([ 0.])
 fk: nan
     Entering sub-algorithm.

         Newton minimisation
         ~~~~~~~~~~~~~~~~~~~
         Line search:  Backtracking line search.
         Hessian modification:  The Gill, Murray, and Wright modified
Cholesky algorithm.

         k: 0       xk: array([ 0.])
            fk: nan

and then seems stuck in a loop (I guess waiting for nan to reach some
tolerance?)

Obviously the original error is easy to catch, but very different errors
could easily have the same effect in the grid search and minimiser, so the
question is how to catch things there?







    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?func=detailitem&item_id=6503>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/





Related Messages


Powered by MHonArc, Updated Fri Aug 04 19:20:22 2006