Oh, don't worry about the large f(x) values:

Progress:   62.585%,  array([  6.500000000000000e+00,   5.500000000000000e-01,
         1.049995000000000e+04]),  f(x): 2e+202
Progress:   62.812%,  array([  6.500000000000000e+00,   5.750000000000001e-01,
         1.049995000000000e+04]),  f(x): 2e+202
Progress:   63.039%,  array([  6.500000000000000e+00,   6.000000000000001e-01,
         1.049995000000000e+04]),  f(x): 2e+202
Progress:   63.265%,  array([  6.500000000000000e+00,   6.250000000000001e-01,
         1.049995000000000e+04]),  f(x): 2e+202

These are the end points of a row of points.  If you cat the 'map'
file, you will see that all row end points are
100000000000000000000.000000.  For a high quality map, you might want
the dx.map inc argument cranked up to 50 (that makes a 4 Mb file).  Or
inc=100, which I use for paper quality figures.  The bigger the better
(as long as it doesn't use up all the RAM displaying it).  Using the
upper and lower arguments to zoom into the space also helps a lot.

As for fighting - you're killing the code!  You've learn so many
tricks for code optimisation and for using many new features of relax.
 For your project, the 3D space mapping and code optimisation tricks
will really give you an edge.  And the pace of your code advancements
in relax are incredible.  Soon the B14 model implementation will be
100% complete and fully optimised!  You'll be able to very quickly
branch this into a 'B14' and 'B14 full' model (with R20A == R20B and
R20A != R20B respectively).  Two completely new models in relax in
what will probably be less than 5 days working on it - not bad.
Especially considering that a lot of time was spent of finding
problems in the equations.  I'm rather impressed :)  I have a feeling
that with your new code optimisation knowledge, that you'll soon be
looking at the other dispersion models you are interested in and
making them much faster too.  And by looking directly at optimisation
spaces, something which most people would never do as it's quite
difficult to visualise, you'll gain an insight that not many in the
field have.

Regards,

Edward



On 5 May 2014 20:48, Troels Emtekær Linnet <tlin...@nmr-relax.com> wrote:
> Can you give a hint?
>
> I need to fix this rather fast, and get on with some relax problems.
>
> I think I can probably convince you, that relax have some issues.
> I have several times seen "inf" values in the minimisation algorithm.
>
> Try
> cp 
> $HOME/software/NMR-relax/relax_trunk/test_suite/system_tests/scripts/relax_disp/cpmg_synthetic.py
> .
> Set ds.GRID_INC = None.
> Set ds.opendx = False
>
> And see that the function value goes bananas!
>
> Why is this ????
>
> Is it because of lib/dispersion/cr72.py
> where:
> ####################
>         # Catch large values of etapos going into the cosh function.
>         if etapos > 100:
>             back_calc[i] = 1e100
>             continue
>
>         # The arccosh argument - catch invalid values.
>         fact = Dpos * cosh(etapos) - Dneg * cos(etaneg)
>         if fact < 1.0:
>             back_calc[i] = r20_kex
>             continue
> ###################
>
>
> Or is it because that:
> relax_trunk/specific_analyses/relax_disp/parameters.py linear_constraints() 
> has:
> 0 <= kex <= 2e6
>
> That should really only be:
> CPMG: 10.000
> R1rho: 50.000 - 100.000 ?
>
> But not: 2000000 !
> No experiment can see this ???
>
> Or is it because there is no minimisation restraint on dw?
> So it can just fly out of the scale.
>
>
> Jesus.
> Something is wrong....
> I know it, but I simply can't prove to you, before I get that map. :-)
>
> There must be a hill over dw, pA and kex.
>
> A chi2 of pA=0.5 with high dw, must nearly be the same as pA=0.9x with low dw.
> And relax is not happy for low dw.
>
> So it goes out of scale on dw, finding pA=0.5.
>
> Or is it in the scaling matrix?
>
> Best
> The fighting Troels
>
>
>
>
>
>
>
> 2014-05-05 17:48 GMT+02:00 Edward d'Auvergne <edw...@nmr-relax.com>:
>> The Map.map_3D_text() method was designed for single spin model-free
>> models.  It fails otherwise.  This might be a case of not enough user
>> feedback.  It will be easy to fix though.
>>
>> Regards,
>>
>> Edward
>>
>>
>>
>> On 5 May 2014 17:45, Edward d'Auvergne <edw...@nmr-relax.com> wrote:
>>> Ok, now I can reproduce it :)  It is the Map.map_3D_text() method of
>>> the pipe_control.opendx module where the problem really is.
>>>
>>> Regards,
>>>
>>> Edward
>>>
>>>
>>>
>>> On 5 May 2014 17:37, Troels Emtekær Linnet <tlin...@nmr-relax.com> wrote:
>>>> When reverting the change, you can get the bug by:
>>>>
>>>> relax test_suite/system_tests/scripts/relax_disp/cpmg_synthetic.py
>>>>
>>>> 2014-05-05 17:36 GMT+02:00 Troels Emtekær Linnet <tlin...@nmr-relax.com>:
>>>>> Hi Edward.
>>>>>
>>>>> Sorry for being unclear.
>>>>>
>>>>> It is this comment:
>>>>> https://gna.org/bugs/?22012#comment3
>>>>>
>>>>>
>>>>>
>>>>> dx.map(params=['dw', 'pA', 'kex'], map_type='Iso3D', spin_id=':1@N',
>>>>> inc=20, lower=None, upper=None, axis_incs=5, file_prefix='map',
>>>>> dir=None, point=None, point_file='point', remap=None)
>>>>>
>>>>> Creating the OpenDX .net program file.
>>>>> Opening the file 'map.net' for writing.
>>>>>
>>>>> Creating the OpenDX .cfg program configuration file.
>>>>> Opening the file 'map.cfg' for writing.
>>>>>
>>>>> Creating the OpenDX .general file.
>>>>> Opening the file 'map.general' for writing.
>>>>>
>>>>> Creating the map.
>>>>> Opening the file 'map' for writing.
>>>>> Progress: 0.000%
>>>>> RelaxWarning: invalid value encountered in double_scalars
>>>>> debug> Execution lock: Release by 'script UI' ('script' mode).
>>>>> Traceback (most recent call last):
>>>>> File "/Users/tlinnet/software/relax_trunk/multi/processor.py", line 494, 
>>>>> in run
>>>>> self.callback.init_master(self)
>>>>> File "/Users/tlinnet/software/relax_trunk/multi/__init__.py", line
>>>>> 318, in default_init_master
>>>>> self.master.run()
>>>>> File "/Users/tlinnet/software/relax_trunk/relax.py", line 194, in run
>>>>> self.interpreter.run(self.script_file)
>>>>> File "/Users/tlinnet/software/relax_trunk/prompt/interpreter.py", line
>>>>> 275, in run
>>>>> return run_script(intro=self.__intro_string, local=locals(),
>>>>> script_file=script_file, show_script=self.__show_script,
>>>>> raise_relax_error=self.__raise_relax_error)
>>>>> File "/Users/tlinnet/software/relax_trunk/prompt/interpreter.py", line
>>>>> 569, in run_script
>>>>> return console.interact(intro, local, script_file,
>>>>> show_script=show_script, raise_relax_error=raise_relax_error)
>>>>> File "/Users/tlinnet/software/relax_trunk/prompt/interpreter.py", line
>>>>> 468, in interact_script
>>>>> exec_script(script_file, local)
>>>>> File "/Users/tlinnet/software/relax_trunk/prompt/interpreter.py", line
>>>>> 347, in exec_script
>>>>> runpy.run_module(module, globals)
>>>>> File 
>>>>> "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/runpy.py",
>>>>> line 180, in run_module
>>>>> fname, loader, pkg_name)
>>>>> File 
>>>>> "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/runpy.py",
>>>>> line 72, in _run_code
>>>>> exec code in run_globals
>>>>> File 
>>>>> "/Users/tlinnet/software/relax_trunk/test_suite/system_tests/scripts/relax_disp/cpmg_synthetic.py",
>>>>> line 277, in <module>
>>>>> dx.map(params=['dw', 'pA', 'kex'], map_type='Iso3D', spin_id=":1@N",
>>>>> inc=20, lower=None, upper=None, axis_incs=5, file_prefix='map',
>>>>> dir=ds.resdir, point=None, point_file='point', remap=None)
>>>>> File "/Users/tlinnet/software/relax_trunk/prompt/uf_objects.py", line
>>>>> 221, in _call_
>>>>> self._backend(*new_args, **uf_kargs)
>>>>> File "/Users/tlinnet/software/relax_trunk/pipe_control/opendx.py",
>>>>> line 88, in map
>>>>> Map(params, spin_id, inc, lower, upper, axis_incs, file_prefix, dir,
>>>>> point, point_file, remap)
>>>>> File "/Users/tlinnet/software/relax_trunk/pipe_control/opendx.py",
>>>>> line 184, in _init_
>>>>> self.create_map()
>>>>> File "/Users/tlinnet/software/relax_trunk/pipe_control/opendx.py",
>>>>> line 197, in create_map
>>>>> self.map_3D_text(map_file)
>>>>> File "/Users/tlinnet/software/relax_trunk/pipe_control/opendx.py",
>>>>> line 255, in map_3D_text
>>>>> k, n, chi2 = self.model_statistics(spin_id=self.spin_id)
>>>>> File 
>>>>> "/Users/tlinnet/software/relax_trunk/specific_analyses/relax_disp/api.py",
>>>>> line 683, in model_statistics
>>>>> spins = spin_ids_to_containers(spin_ids)
>>>>> File 
>>>>> "/Users/tlinnet/software/relax_trunk/specific_analyses/relax_disp/data.py",
>>>>> line 3620, in spin_ids_to_containers
>>>>> for id in spin_ids:
>>>>> TypeError: 'NoneType' object is not iterable
>>>>>
>>>>> 2014-05-05 17:27 GMT+02:00 Edward d'Auvergne <edw...@nmr-relax.com>:
>>>>>> The argument checking is reasonable, but the code:
>>>>>>
>>>>>> +        #spins = spin_ids_to_containers(spin_ids)
>>>>>> +
>>>>>> +        spins_list = []
>>>>>> +        for spin_id in self.model_loop():
>>>>>> +            spins_list.append(spin_id[0])
>>>>>> +
>>>>>> +        spins = spin_ids_to_containers(spins_list)
>>>>>>
>>>>>> breaks the logic.  This cannot be done, as the code calling
>>>>>> model_statistics() must be looping over the models (i.e. the
>>>>>> model_loop()), so you cannot have the model_loop() inside it.  Any API
>>>>>> method which accepts the model_info argument will follow this logic.
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Edward
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 5 May 2014 17:23, Edward d'Auvergne <edw...@nmr-relax.com> wrote:
>>>>>>> The original code was correct.  The full test suite passes when this
>>>>>>> change is not included.  Why did you make this change?  What was the
>>>>>>> purpose?  I'm a little confused.
>>>>>>>
>>>>>>> Regards,
>>>>>>>
>>>>>>> Edward
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 5 May 2014 17:15, Troels Emtekær Linnet <tlin...@nmr-relax.com> 
>>>>>>> wrote:
>>>>>>>> Ehhhh.
>>>>>>>>
>>>>>>>> Can you suggest a change?
>>>>>>>>
>>>>>>>> Best
>>>>>>>> Troels
>>>>>>>>
>>>>>>>> 2014-05-05 17:05 GMT+02:00 Edward d'Auvergne <edw...@nmr-relax.com>:
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> I now have the failure when running:
>>>>>>>>>
>>>>>>>>> $ ./relax -s Relax_disp.test_hansen_cpmg_data_auto_analysis
>>>>>>>>>
>>>>>>>>> This is because the change is incorrect.  The model_statistics()
>>>>>>>>> method is called once for each individual model - for each iteration
>>>>>>>>> of the model_loop(), which for the dispersion analysis is each spin
>>>>>>>>> cluster (or individual spins).  The logic:
>>>>>>>>>
>>>>>>>>>         spins_list = []
>>>>>>>>>         for spin_id in self.model_loop():
>>>>>>>>>             spins_list.append(spin_id[0])
>>>>>>>>>
>>>>>>>>>         spins = spin_ids_to_containers(spins_list)
>>>>>>>>>
>>>>>>>>> is incorrect as the model_loop() loops over all spin clusters.
>>>>>>>>> Therefore the 'spins' object will now be a list of the first spin
>>>>>>>>> system from all clusters.  Previously it was simply a list of all the
>>>>>>>>> spins for the current spin cluster.  I hope this makes sense.
>>>>>>>>>
>>>>>>>>> Regards,
>>>>>>>>>
>>>>>>>>> Edward
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 5 May 2014 16:52, Troels Emtekær Linnet <tlin...@nmr-relax.com> 
>>>>>>>>> wrote:
>>>>>>>>>> Now ready to be tested with:
>>>>>>>>>>
>>>>>>>>>> relax -s Relax_disp.test_hansen_cpmg_data_auto_analysis -d
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ---------- Forwarded message ----------
>>>>>>>>>> From:  <tlin...@nmr-relax.com>
>>>>>>>>>> Date: 2014-05-05 16:46 GMT+02:00
>>>>>>>>>> Subject: r22958 - /trunk/specific_analyses/relax_disp/api.py
>>>>>>>>>> To: relax-comm...@gna.org
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Author: tlinnet
>>>>>>>>>> Date: Mon May  5 16:46:10 2014
>>>>>>>>>> New Revision: 22958
>>>>>>>>>>
>>>>>>>>>> URL: http://svn.gna.org/viewcvs/relax?rev=22958&view=rev
>>>>>>>>>> Log:
>>>>>>>>>> Inserted commit r22954 to fix the AIC method selection.
>>>>>>>>>>
>>>>>>>>>> The command used was:
>>>>>>>>>> svn merge -r22953:r22954 .
>>>>>>>>>>
>>>>>>>>>> .....
>>>>>>>>>>     Attempt to fix function model_statistics() in API for relax_disp.
>>>>>>>>>>
>>>>>>>>>>     bug #22012(https://gna.org/bugs/?22012): dx.map not implemented
>>>>>>>>>> for pipe type relax_disp.
>>>>>>>>>>
>>>>>>>>>>     Modified:
>>>>>>>>>>         trunk/specific_analyses/relax_disp/api.py
>>>>>>>>>> .....
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Modified:
>>>>>>>>>>     trunk/specific_analyses/relax_disp/api.py
>>>>>>>>>>
>>>>>>>>>> Modified: trunk/specific_analyses/relax_disp/api.py
>>>>>>>>>> URL: 
>>>>>>>>>> http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/relax_disp/api.py?rev=22958&r1=22957&r2=22958&view=diff
>>>>>>>>>> ==============================================================================
>>>>>>>>>> --- trunk/specific_analyses/relax_disp/api.py   (original)
>>>>>>>>>> +++ trunk/specific_analyses/relax_disp/api.py   Mon May  5 16:46:10 
>>>>>>>>>> 2014
>>>>>>>>>> @@ -678,9 +678,21 @@
>>>>>>>>>>          @rtype:                 tuple of (int, int, float)
>>>>>>>>>>          """
>>>>>>>>>>
>>>>>>>>>> +        # Bad argument combination.
>>>>>>>>>> +        if model_info == None and spin_id == None:
>>>>>>>>>> +            raise RelaxError("Either the model_info or spin_id
>>>>>>>>>> argument must be supplied.")
>>>>>>>>>> +        elif model_info != None and spin_id != None:
>>>>>>>>>> +            raise RelaxError("The model_info arg " + 
>>>>>>>>>> repr(model_info)
>>>>>>>>>> + " and spin_id arg " + repr(spin_id) + " clash.  Only one should be
>>>>>>>>>> supplied.")
>>>>>>>>>> +
>>>>>>>>>>          # Unpack the data.
>>>>>>>>>>          spin_ids = model_info
>>>>>>>>>> -        spins = spin_ids_to_containers(spin_ids)
>>>>>>>>>> +        #spins = spin_ids_to_containers(spin_ids)
>>>>>>>>>> +
>>>>>>>>>> +        spins_list = []
>>>>>>>>>> +        for spin_id in self.model_loop():
>>>>>>>>>> +            spins_list.append(spin_id[0])
>>>>>>>>>> +
>>>>>>>>>> +        spins = spin_ids_to_containers(spins_list)
>>>>>>>>>>
>>>>>>>>>>          # The number of parameters for the cluster.
>>>>>>>>>>          k = param_num(spins=spins)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> _______________________________________________
>>>>>>>>>> relax (http://www.nmr-relax.com)
>>>>>>>>>>
>>>>>>>>>> This is the relax-commits mailing list
>>>>>>>>>> relax-comm...@gna.org
>>>>>>>>>>
>>>>>>>>>> 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-commits
>>>>>>>>>>
>>>>>>>>>> _______________________________________________
>>>>>>>>>> relax (http://www.nmr-relax.com)
>>>>>>>>>>
>>>>>>>>>> This is the relax-devel mailing list
>>>>>>>>>> relax-devel@gna.org
>>>>>>>>>>
>>>>>>>>>> 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

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

This is the relax-devel mailing list
relax-devel@gna.org

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

Reply via email to