mailRe: Constraints in full_analysis.py


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

Header


Content

Posted by Sébastien Morin on April 07, 2008 - 23:47:
Hi again,

I just ran a test with the minfx library instead of the "minimise" directory, even though the test-suite fails for the
two last model-free tests.

As expected, the script failed when it reached the minimise() function...


===========================
relax> minimise(*args=('newton',), run='final', func_tol=1e-25, max_iterations=10000000, constraints=1, scaling=1, print_flag=1)
Simulation 1
Traceback (most recent call last):
  File "/home/semor/packages/relax-1.2/relax", line 454, in ?
    Relax()
  File "/home/semor/packages/relax-1.2/relax", line 166, in __init__
    self.interpreter.run()
  File "/home/semor/packages/relax-1.2/prompt/interpreter.py", line 216, in run
    run_script(intro=self.relax.intro_string, local=self.local, script_file=self.relax.script_file, quit=1)
  File "/home/semor/packages/relax-1.2/prompt/interpreter.py", line 391, in run_script
    console.interact(intro, local, script_file, quit)
  File "/home/semor/packages/relax-1.2/prompt/interpreter.py", line 343, in interact_script
    execfile(script_file, local)
  File "./full_analysis_final.py", line 587, in ?
    Main(self.relax)
  File "./full_analysis_final.py", line 313, in __init__
    minimise(MIN_ALGOR, run='final')
  File "/home/semor/packages/relax-1.2/prompt/minimisation.py", line 365, in minimise
    self.relax.generic.minimise.minimise(run=run, min_algor=min_algor, min_options=min_options, func_tol=func_tol, grad_tol=grad_tol, max_iterations=max_iterations, constraints=constraints, scaling=scaling, print_flag=print_flag)
  File "/home/semor/packages/relax-1.2/generic_fns/minimise.py", line 135, in minimise
    minimise(run=run, min_algor=min_algor, min_options=min_options, func_tol=func_tol, grad_tol=grad_tol, max_iterations=max_iterations, constraints=constraints, scaling=scaling, print_flag=print_flag-1, sim_index=i)
  File "/home/semor/packages/relax-1.2/specific_fns/model_free.py", line 2372, in minimise
    results = generic_minimise(func=self.mf.func, dfunc=self.mf.dfunc, d2func=self.mf.d2func, args=(), x0=self.param_vector, min_algor=min_algor, min_options=min_options, func_tol=func_tol, grad_tol=grad_tol, maxiter=max_iterations, A=A, b=b, full_output=1, print_flag=print_flag)
  File "/home/semor/packages/relax-1.3/minfx/generic.py", line 392, in generic_minimise
    results = method_of_multipliers(func=func, dfunc=dfunc, d2func=d2func, args=args, x0=x0, min_options=min_options, A=A, b=b, l=l, u=u, c=c, dc=dc, d2c=d2c, func_tol=func_tol, grad_tol=grad_tol, maxiter=maxiter, full_output=full_output, print_flag=print_flag)
  File "/home/semor/packages/relax-1.3/minfx/method_of_multipliers.py", line 143, in method_of_multipliers
    results = min.minimise()
  File "/home/semor/packages/relax-1.3/minfx/method_of_multipliers.py", line 397, in minimise
    results = self.generic_minimise(func=self.func_LA, dfunc=self.func_dLA, d2func=self.func_d2LA, args=self.args, x0=self.xk, min_algor=self.min_algor, min_options=self.min_options, func_tol=None, grad_tol=self.tk, maxiter=maxiter, full_output=1, print_flag=sub_print_flag, print_prefix="\t")
  File "/home/semor/packages/relax-1.3/minfx/generic.py", line 323, in generic_minimise
    results = newton(func=func, dfunc=dfunc, d2func=d2func, args=args, x0=x0, min_options=min_options, func_tol=func_tol, grad_tol=grad_tol, maxiter=maxiter, full_output=full_output, print_flag=print_flag, print_prefix=print_prefix)
  File "/home/semor/packages/relax-1.3/minfx/newton.py", line 44, in newton
    results = min.minimise()
  File "/home/semor/packages/relax-1.3/minfx/base_classes.py", line 233, in minimise
    self.new_param_func()
  File "/home/semor/packages/relax-1.3/minfx/newton.py", line 163, in new_param_func
    self.pk = self.get_pk()
  File "/home/semor/packages/relax-1.3/minfx/base_classes.py", line 642, in gmw
    return gmw(self.dfk, self.d2fk, self.I, self.n, self.mach_acc, self.print_prefix, self.print_flag, return_matrix)
  File "/home/semor/packages/relax-1.3/minfx/hessian_mods/gmw81.py", line 150, in gmw
    y = solve(L, dfk)
  File "/usr/lib/python2.4/site-packages/numpy/linalg/linalg.py", line 179, in solve
    t, result_t = _commonType(a, b)
  File "/usr/lib/python2.4/site-packages/numpy/linalg/linalg.py", line 71, in _commonType
    if issubclass(a.dtype.type, inexact):
AttributeError: dtype
===========================


I'm not familiar with the minfx package, but this error as probably nothing to do with the constraints problem...

More to come... Stay tuned...


Séb





Sébastien Morin wrote:
Hi Ed,

I posted a bug report. As you will see, I found also the problem in normal optimization at the end of each round for the 4 diffusion models (sphere, prolate, oblate and ellipsoid)...

Also, I used the normal minimise library. After reading your mail, I tried to use the minfx library as I do in the 1.3 line, but simply making a link wouldn't completely work (the test-suite failing for the two last model-free tests :

==========================
    Constrained Newton opt, GMW Hessian mod, backtracking line search {S2=0.970, te=2048, Rex=0.149}  [ Failed ]
    Constrained Newton opt, GMW Hessian mod, More and Thuente line search {S2=0.970, te=2048, Rex=0.149}  [ Failed ]
==========================

Moreover, the --debug option wouldn't give more details concerning the incorrect supply of the constraints...

I'll try to dig further...

Cheers


Séb





Edward d'Auvergne wrote:
Hi Seb,

That's an interesting one.  That message is a debugging statement that
should only be triggered if someone goes into the relax source code
and tries to reprogram the constraints algorithm or tries to implement
a completely new algorithm.  It shouldn't appear in the 1.2 stable
releases and I haven't seen it since I first coded the Method of
Multipliers constraint algorithm.  Which version of relax are you
using?  Are you using the minfx library which was spun off from relax
(https://gna.org/projects/minfx/)?

I think, though, that you would be highly capable of being able to
debug the problem yourself, probably using solely print statements.
The message comes from the minimise/method_of_multipliers.py file.  It
should only occur if either of the constraint matrices A and b
returned by the model-free linear_constraints() method are set to
None.  This method is the same for the normal optimisation and Monte
Carlo simulations, so I can't see what the problem is myself (well,
more information about the problem would be required).  The model-free
minimise() method also is run almost identically by both the normal
optimisation and the simulations.  So debugging this one will be very
simple (for me I'd need to be able to reproduce the problem exactly
before I could even start, something I'm currently incapable of
doing).  Something has caused one of these functions to go a bit
crazy, and if this occurs in the 1.2 line, and we can come up with a
fix, I'll then release a new version of relax.  Could you make a bug
report for this?

Cheers,

Edward




On Mon, Apr 7, 2008 at 9:40 PM, Sébastien Morin
<sebastien.morin.1@xxxxxxxxx> wrote:
  
Hi,

 I am using the full_analysis.py script and got an intriguing warning in
 the "final" step. It seems there is a problem with the setting of the
 constraints for the minimise() function during monte carlo simulations...


 ==================
 relax> minimise(*args=('newton',), run='final', func_tol=1e-25,
 max_iterations=10000000, constraints=1, scaling=1, print_flag=1)
 Simulation 1
 The constraints have been incorrectly supplied.
 Simulation 2
 The constraints have been incorrectly supplied.
 ...
 ==================


 This problem arises for every single simulation.

 Is this a serious problem ? Will the simulated errors be erroneous or is
 this just a warning ?

 Does anyone have a clue about the reason for that ?

 Thanks !


 Sébastien  :)


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

 This is the relax-users mailing list
 relax-users@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-users

    

  

_______________________________________________ relax (http://nmr-relax.com) This is the relax-users mailing list relax-users@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-users

Related Messages


Powered by MHonArc, Updated Tue Apr 08 09:41:09 2008