Menu

SVN archive Commit Log


Commit Date  
[r25335] by bugman

Changed the relax_fit.py sample script to use Newton rather than Simplex optimisation.

This can lead to significantly faster optimisation times, as shown in the commit message
http://article.gmane.org/gmane.science.nmr.relax.scm/23081.

2014-08-27 11:38:24 Tree
[r25334] by tlinnet

Implemented the use of "Newton" as minimisation algorithm for R2eff curve fitting instead of simplex.

Running the test script:
test_suite/shared_data/dispersion/Kjaergaard_et_al_2013/2_pre_run_r2eff.py

For 50 Monte-Carlo simulations, the time drop from:
3 minutes and 13 s, to 1 min an 5 seconds.

task #7822(https://gna.org/task/index.php?7822): Implement user function to estimate R2eff and associated errors for exponential curve fitting.

2014-08-27 11:22:45 Tree
[r25333] by tlinnet

Set the constraints=False, when doing Monte-Carlo simulations for R2eff.

This is to speed-up the Monte-Carlo simulations by a factor X10, when estimating the error for R2eff.

task #7822(https://gna.org/task/index.php?7822): Implement user function to estimate R2eff and associated errors for exponential curve fitting.

2014-08-27 11:22:43 Tree
[r25332] by tlinnet

Tried to verify solution to profiling script.

task #7822(https://gna.org/task/index.php?7822): Implement user function to estimate R2eff and associated errors for exponential curve fitting.

2014-08-27 11:22:41 Tree
[r25331] by tlinnet

Modified profiling script to calculate timings.

The timings for C-code are:
Simplex, with constraints = 2.192
Simplex, without constraints = 0.216
BFGS, without constraints = 0.079
Newton, without constraints = 0.031

This is pretty pretty fast.

To this profiling script, I would also now add some verification on calculations.

Profile, with constraints, C code, Simplex
Wed Aug 27 11:45:16 2014 /var/folders/ww/1jkhkh315x57jglgxnr9g24w0000gp/T/tmpvJSNrB

724946 function calls (723444 primitive calls) in 2.192 seconds

Ordered by: cumulative time
List reduced from 307 to 1 due to restriction <1>

ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 2.192 2.192 profiling_relax_fit.py:314(verify)

Verify, without constraints, C code, Simplex
Wed Aug 27 11:45:16 2014 /var/folders/ww/1jkhkh315x57jglgxnr9g24w0000gp/T/tmphJ9GV3

76042 function calls (74654 primitive calls) in 0.216 seconds

Ordered by: cumulative time
List reduced from 132 to 1 due to restriction <1>

ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 0.216 0.216 profiling_relax_fit.py:314(verify)

Verify, without constraints, C code BFGS
Wed Aug 27 11:45:16 2014 /var/folders/ww/1jkhkh315x57jglgxnr9g24w0000gp/T/tmp78MZjS

25618 function calls (24230 primitive calls) in 0.079 seconds

Ordered by: cumulative time
List reduced from 153 to 1 due to restriction <1>

ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 0.079 0.079 profiling_relax_fit.py:314(verify)

Verify, without constraints, C code Newton
Wed Aug 27 11:45:16 2014 /var/folders/ww/1jkhkh315x57jglgxnr9g24w0000gp/T/tmp2IPgFC

14572 function calls (13184 primitive calls) in 0.031 seconds

Ordered by: cumulative time
List reduced from 169 to 1 due to restriction <1>

ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 0.031 0.031 profiling_relax_fit.py:314(verify)

Verify, with constraints, Python, Simplex
Wed Aug 27 11:45:20 2014 /var/folders/ww/1jkhkh315x57jglgxnr9g24w0000gp/T/tmpQUUY4L

808444 function calls (806942 primitive calls) in 3.108 seconds

Ordered by: cumulative time
List reduced from 141 to 1 due to restriction <1>

ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 3.108 3.108 profiling_relax_fit.py:353(verify_pyt)

Verify, without constraints, Python, Simplex
Wed Aug 27 11:45:20 2014 /var/folders/ww/1jkhkh315x57jglgxnr9g24w0000gp/T/tmp3nFBTq

87492 function calls (86104 primitive calls) in 0.320 seconds

Ordered by: cumulative time
List reduced from 131 to 1 due to restriction <1>

ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 0.320 0.320 profiling_relax_fit.py:353(verify_pyt)

Verify, without constraints, Python Scipy
Wed Aug 27 11:45:20 2014 /var/folders/ww/1jkhkh315x57jglgxnr9g24w0000gp/T/tmpo1HoWn

6600 function calls (5212 primitive calls) in 0.020 seconds

Ordered by: cumulative time
List reduced from 137 to 1 due to restriction <1>

ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 0.020 0.020 profiling_relax_fit.py:388(verify_sci)

task #7822(https://gna.org/task/index.php?7822): Implement user function to estimate R2eff and associated errors for exponential curve fitting.

2014-08-27 09:49:21 Tree
[r25330] by tlinnet

Tried to implement the Jacobian from C-code.

This though also report errors which are to small.

Maybe some scaling is wrong.

task #7822(https://gna.org/task/index.php?7822): Implement user function to estimate R2eff and associated errors for exponential curve fitting.

2014-08-27 09:29:24 Tree
[r25329] by tlinnet

Implemented the first try to compute the Variance of R2eff and i0, by the co-variance.

This uses the Jacobian matrix.
The errors calculated, are though way to small compared 2000 Monte-Carlo simulations.

task #7822(https://gna.org/task/index.php?7822): Implement user function to estimate R2eff and associated errors for exponential curve fitting.

2014-08-27 09:12:50 Tree
[r25328] by bugman

Merged revisions 25317-25319,25321-25327 via svnmerge from
svn+ssh://bugman@.../svn/relax/trunk

........
r25317 | bugman | 2014-08-26 19:38:01 +0200 (Tue, 26 Aug 2014) | 8 lines

Added a script and log file for calculating the numerical gradient for an exponential curve.

This uses the data at http://thread.gmane.org/gmane.science.nmr.relax.devel/6807/focus=6840 and
calculates the Hessian using the numdifftools.Hessian object construct and obtain the matrix, both
at the minimum and at a point away from the minimum. The values will be used to construct a unit
test to check the C module implementation.
........
r25318 | bugman | 2014-08-26 19:49:36 +0200 (Tue, 26 Aug 2014) | 3 lines

Fixes for the Hessian.py script for numerical integrating the Hessian for an exponential curve.
........
r25319 | bugman | 2014-08-26 19:51:12 +0200 (Tue, 26 Aug 2014) | 7 lines

Implemented two unit tests to check the Hessian of the target_functions.relax_fit.d2func() function.

This compares the calculated Hessian to the numerically integrated values from the
test_suite/shared_data/curve_fitting/numeric_gradient/Hessian.py script, showing that the d2func()
function is implemented correctly.
........
r25321 | tlinnet | 2014-08-27 08:50:56 +0200 (Wed, 27 Aug 2014) | 3 lines

Modified profiling script, but it seems that the dfunc from target_functions.relax_fit does not work.

task #7822(https://gna.org/task/index.php?7822): Implement user function to estimate R2eff and associated errors for exponential curve fitting.
........
r25322 | tlinnet | 2014-08-27 09:19:45 +0200 (Wed, 27 Aug 2014) | 4 lines

Modified estimate R2eff module, to use C-code.

But systemtest Relax_disp.test_estimate_r2eff_error shows that the Jacobian is not correctly implemented
to be called in minfx.
........
r25323 | bugman | 2014-08-27 09:47:13 +0200 (Wed, 27 Aug 2014) | 7 lines

Created an initial test suite data directory for a mixed R1rho + CPMG dispersion analysis.

The generate.py script will be extended in the future to generate both synthetic R1rho and CPMG data
for a common exchange process. Such a data combination should show some minor flaws in the current
design of the dispersion analysis and will help to solve these.
........
r25324 | bugman | 2014-08-27 10:01:54 +0200 (Wed, 27 Aug 2014) | 7 lines

Improvements to the pipe_control.minimise.reset_min_stats() function.

The minimise statistics resetting is now more elegantly implemented. And the sim_index keyword
argument is accepted by the function and individual Monte Carlo simulation elements can now be
reset.
........
r25325 | tlinnet | 2014-08-27 10:05:03 +0200 (Wed, 27 Aug 2014) | 3 lines

Modified wrapper function for curve_fit, to only change to list type, if the type is a ndarray.

task #7822(https://gna.org/task/index.php?7822): Implement user function to estimate R2eff and associated errors for exponential curve fitting.
........
r25326 | bugman | 2014-08-27 10:10:57 +0200 (Wed, 27 Aug 2014) | 6 lines

The model-free reset_min_stats() function has been replaced with the pipe_control.minimise version.

The specific_analyses.model_free.optimisation.reset_min_stats() function has been deleted and
instead the pipe_control.minimise version is being used.
........
r25327 | bugman | 2014-08-27 10:45:28 +0200 (Wed, 27 Aug 2014) | 11 lines

The minimisation statistics are now being reset for all analysis types.

The minimise.calcululate, minimise.grid_search, and minimise.execute user functions now all reset
the minimisation statistics for either the model or the Monte Carlo simulations prior to performing
any optimisation. This is required for both parallelised grid searches and repetitive optimisation
schemes to allow the result to overwrite an old result in all situations, as sometimes the original
chi-squared value is lower and the new result hence is rejected.

The equivalent functionality from the model-free minimise() API method has been removed.
........

2014-08-27 08:54:27 Tree
[r25327] by bugman

The minimisation statistics are now being reset for all analysis types.

The minimise.calcululate, minimise.grid_search, and minimise.execute user functions now all reset
the minimisation statistics for either the model or the Monte Carlo simulations prior to performing
any optimisation. This is required for both parallelised grid searches and repetitive optimisation
schemes to allow the result to overwrite an old result in all situations, as sometimes the original
chi-squared value is lower and the new result hence is rejected.

The equivalent functionality from the model-free minimise() API method has been removed.

2014-08-27 08:45:28 Tree
[r25326] by bugman

The model-free reset_min_stats() function has been replaced with the pipe_control.minimise version.

The specific_analyses.model_free.optimisation.reset_min_stats() function has been deleted and
instead the pipe_control.minimise version is being used.

2014-08-27 08:10:57 Tree
Older >
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.