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 Chris MacRaild on August 03, 2006 - 11:25:

On Wed, 2006-08-02 at 22:58 +1000, Edward d'Auvergne wrote:
...

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.

I'll look into it, but perhaps its sufficient to catch NaNs before they
cause the problen in the first place (though this might be harder than
it seems, see below...). Certainly it seems to me that the Grid Search
should report failure if it cant find a function value less than 1e300.
This should ensure the starting point of the minimisation always
evaluates to a finite floating-point value, as long the user always does
a grid search first.


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. 

I'm using Python 2.4.1 and Numeric 24.0, but I don't think that matters.
From what I can gather Python inherits its fp behaviour almost entirely
from the underlying hardware/libc combination. This means NaN behaviour
is platform dependent, and all the obvious ways of catching NaNs (and
INFs and other special floats) tend to be non-portable (including NaN !=
NaN). I'll look into other options.

Chris


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/



_______________________________________________
relax (http://nmr-relax.com)

This is the relax-devel mailing list
relax-devel@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-devel





Related Messages


Powered by MHonArc, Updated Thu Aug 03 16:00:20 2006