mailr24578 - in /branches/zooming_grid_search/specific_analyses: frame_order/ model_free/ n_state_model/ relax_disp/ relax_fit/


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

Header


Content

Posted by edward on July 21, 2014 - 09:14:
Author: bugman
Date: Mon Jul 21 09:14:00 2014
New Revision: 24578

URL: http://svn.gna.org/viewcvs/relax?rev=24578&view=rev
Log:
Updated all of the specific API grid_search() methods to accept the 
scaling_matrix argument.

The list of per-model scaling matrices is now created independently of the 
analysis type by the
pipe_control.minimise methods for the minimise.calculate, 
minimise.grid_search and minimise.execute
user functions and sent into the specific analysis backend.

The argument is also passed into the minimise() API method from the 
grid_search() method when that
is used.


Modified:
    branches/zooming_grid_search/specific_analyses/frame_order/api.py
    branches/zooming_grid_search/specific_analyses/model_free/api.py
    branches/zooming_grid_search/specific_analyses/n_state_model/api.py
    branches/zooming_grid_search/specific_analyses/relax_disp/api.py
    branches/zooming_grid_search/specific_analyses/relax_fit/api.py

Modified: branches/zooming_grid_search/specific_analyses/frame_order/api.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/zooming_grid_search/specific_analyses/frame_order/api.py?rev=24578&r1=24577&r2=24578&view=diff
==============================================================================
--- branches/zooming_grid_search/specific_analyses/frame_order/api.py   
(original)
+++ branches/zooming_grid_search/specific_analyses/frame_order/api.py   Mon 
Jul 21 09:14:00 2014
@@ -328,21 +328,23 @@
         return assemble_param_vector(sim_index=sim_index)
 
 
-    def grid_search(self, lower=None, upper=None, inc=None, 
constraints=False, verbosity=0, sim_index=None):
+    def grid_search(self, lower=None, upper=None, inc=None, 
scaling_matrix=None, constraints=False, verbosity=0, sim_index=None):
         """Perform a grid search.
 
-        @keyword lower:         The lower bounds of the grid search which 
must be equal to the number of parameters in the model.
-        @type lower:            list of float
-        @keyword upper:         The upper bounds of the grid search which 
must be equal to the number of parameters in the model.
-        @type upper:            list of float
-        @keyword inc:           The increments for each dimension of the 
space for the grid search. The number of elements in the array must equal to 
the number of parameters in the model.
-        @type inc:              int or list of int
-        @keyword constraints:   If True, constraints are applied during the 
grid search (eliminating parts of the grid).  If False, no constraints are 
used.
-        @type constraints:      bool
-        @keyword verbosity:     A flag specifying the amount of information 
to print.  The higher the value, the greater the verbosity.
-        @type verbosity:        int
-        @keyword sim_index:     The Monte Carlo simulation index.
-        @type sim_index:        None or int
+        @keyword lower:             The lower bounds of the grid search 
which must be equal to the number of parameters in the model.
+        @type lower:                list of float
+        @keyword upper:             The upper bounds of the grid search 
which must be equal to the number of parameters in the model.
+        @type upper:                list of float
+        @keyword inc:               The increments for each dimension of the 
space for the grid search. The number of elements in the array must equal to 
the number of parameters in the model.
+        @type inc:                  int or list of int
+        @keyword scaling_matrix:    The per-model list of diagonal and 
square scaling matrices.
+        @type scaling_matrix:       list of numpy rank-2, float64 array or 
list of None
+        @keyword constraints:       If True, constraints are applied during 
the grid search (eliminating parts of the grid).  If False, no constraints 
are used.
+        @type constraints:          bool
+        @keyword verbosity:         A flag specifying the amount of 
information to print.  The higher the value, the greater the verbosity.
+        @type verbosity:            int
+        @keyword sim_index:         The Monte Carlo simulation index.
+        @type sim_index:            None or int
         """
 
         # Test if the Frame Order model has been set up.
@@ -480,7 +482,7 @@
                     indices[j] = 0
 
         # Minimisation.
-        self.minimise(min_algor='grid', min_options=pts, 
constraints=constraints, verbosity=verbosity, sim_index=sim_index)
+        self.minimise(min_algor='grid', min_options=pts, 
scaling_matrix=scaling_matrix, constraints=constraints, verbosity=verbosity, 
sim_index=sim_index)
 
 
     def map_bounds(self, param, spin_id=None):

Modified: branches/zooming_grid_search/specific_analyses/model_free/api.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/zooming_grid_search/specific_analyses/model_free/api.py?rev=24578&r1=24577&r2=24578&view=diff
==============================================================================
--- branches/zooming_grid_search/specific_analyses/model_free/api.py    
(original)
+++ branches/zooming_grid_search/specific_analyses/model_free/api.py    Mon 
Jul 21 09:14:00 2014
@@ -998,32 +998,27 @@
         return assemble_param_vector(spin=spin, sim_index=sim_index, 
model_type=model_type)
 
 
-    def grid_search(self, lower=None, upper=None, inc=None, 
constraints=True, verbosity=1, sim_index=None):
+    def grid_search(self, lower=None, upper=None, inc=None, 
scaling_matrix=None, constraints=True, verbosity=1, sim_index=None):
         """The model-free grid search function.
 
-        @keyword lower:         The lower bounds of the grid search which 
must be equal to the
-                                number of parameters in the model.
-        @type lower:            array of numbers
-        @keyword upper:         The upper bounds of the grid search which 
must be equal to the
-                                number of parameters in the model.
-        @type upper:            array of numbers
-        @keyword inc:           The increments for each dimension of the 
space for the grid search.
-                                The number of elements in the array must 
equal to the number of
-                                parameters in the model.
-        @type inc:              array of int
-        @keyword constraints:   If True, constraints are applied during the 
grid search (eliminating
-                                parts of the grid).  If False, no 
constraints are used.
-        @type constraints:      bool
-        @keyword verbosity:     A flag specifying the amount of information 
to print.  The higher
-                                the value, the greater the verbosity.
-        @type verbosity:        int
-        @keyword sim_index:     The index of the simulation to apply the 
grid search to.  If None,
-                                the normal model is optimised.
-        @type sim_index:        int
+        @keyword lower:             The lower bounds of the grid search 
which must be equal to the number of parameters in the model.
+        @type lower:                array of numbers
+        @keyword upper:             The upper bounds of the grid search 
which must be equal to the number of parameters in the model.
+        @type upper:                array of numbers
+        @keyword inc:               The increments for each dimension of the 
space for the grid search. The number of elements in the array must equal to 
the number of parameters in the model.
+        @type inc:                  array of int
+        @keyword scaling_matrix:    The per-model list of diagonal and 
square scaling matrices.
+        @type scaling_matrix:       list of numpy rank-2, float64 array or 
list of None
+        @keyword constraints:       If True, constraints are applied during 
the grid search (eliminating parts of the grid).  If False, no constraints 
are used.
+        @type constraints:          bool
+        @keyword verbosity:         A flag specifying the amount of 
information to print.  The higher the value, the greater the verbosity.
+        @type verbosity:            int
+        @keyword sim_index:         The index of the simulation to apply the 
grid search to.  If None, the normal model is optimised.
+        @type sim_index:            int
         """
 
         # Minimisation.
-        self.minimise(min_algor='grid', lower=lower, upper=upper, inc=inc, 
constraints=constraints, verbosity=verbosity, sim_index=sim_index)
+        self.minimise(min_algor='grid', lower=lower, upper=upper, inc=inc, 
scaling_matrix=scaling_matrix, constraints=constraints, verbosity=verbosity, 
sim_index=sim_index)
 
 
     def map_bounds(self, param, spin_id=None):

Modified: branches/zooming_grid_search/specific_analyses/n_state_model/api.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/zooming_grid_search/specific_analyses/n_state_model/api.py?rev=24578&r1=24577&r2=24578&view=diff
==============================================================================
--- branches/zooming_grid_search/specific_analyses/n_state_model/api.py 
(original)
+++ branches/zooming_grid_search/specific_analyses/n_state_model/api.py Mon 
Jul 21 09:14:00 2014
@@ -258,19 +258,21 @@
         return mc_data
 
 
-    def grid_search(self, lower=None, upper=None, inc=None, 
constraints=False, verbosity=0, sim_index=None):
+    def grid_search(self, lower=None, upper=None, inc=None, 
scaling_matrix=None, constraints=False, verbosity=0, sim_index=None):
         """The grid search function.
 
-        @param lower:       The lower bounds of the grid search which must 
be equal to the number of parameters in the model.
-        @type lower:        array of numbers
-        @param upper:       The upper bounds of the grid search which must 
be equal to the number of parameters in the model.
-        @type upper:        array of numbers
-        @param inc:         The increments for each dimension of the space 
for the grid search.  The number of elements in the array must equal to the 
number of parameters in the model.
-        @type inc:          array of int
-        @param constraints: If True, constraints are applied during the grid 
search (elinating parts of the grid).  If False, no constraints are used.
-        @type constraints:  bool
-        @param verbosity:   A flag specifying the amount of information to 
print.  The higher the value, the greater the verbosity.
-        @type verbosity:    int
+        @param lower:           The lower bounds of the grid search which 
must be equal to the number of parameters in the model.
+        @type lower:            array of numbers
+        @param upper:           The upper bounds of the grid search which 
must be equal to the number of parameters in the model.
+        @type upper:            array of numbers
+        @param inc:             The increments for each dimension of the 
space for the grid search.  The number of elements in the array must equal to 
the number of parameters in the model.
+        @type inc:              array of int
+        @keyword scaling_matrix:    The per-model list of diagonal and 
square scaling matrices.
+        @type scaling_matrix:       list of numpy rank-2, float64 array or 
list of None
+        @param constraints:     If True, constraints are applied during the 
grid search (elinating parts of the grid).  If False, no constraints are used.
+        @type constraints:      bool
+        @param verbosity:       A flag specifying the amount of information 
to print.  The higher the value, the greater the verbosity.
+        @type verbosity:        int
         """
 
         # Test if the N-state model has been set up.
@@ -381,7 +383,7 @@
 
         # All other minimisation.
         else:
-            self.minimise(min_algor='grid', lower=lower, upper=upper, 
inc=inc, constraints=constraints, verbosity=verbosity, sim_index=sim_index)
+            self.minimise(min_algor='grid', lower=lower, upper=upper, 
inc=inc, scaling_matrix=scaling_matrix, constraints=constraints, 
verbosity=verbosity, sim_index=sim_index)
 
 
     def is_spin_param(self, name):

Modified: branches/zooming_grid_search/specific_analyses/relax_disp/api.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/zooming_grid_search/specific_analyses/relax_disp/api.py?rev=24578&r1=24577&r2=24578&view=diff
==============================================================================
--- branches/zooming_grid_search/specific_analyses/relax_disp/api.py    
(original)
+++ branches/zooming_grid_search/specific_analyses/relax_disp/api.py    Mon 
Jul 21 09:14:00 2014
@@ -466,25 +466,27 @@
         return values
 
 
-    def grid_search(self, lower=None, upper=None, inc=None, 
constraints=True, verbosity=1, sim_index=None):
+    def grid_search(self, lower=None, upper=None, inc=None, 
scaling_matrix=None, constraints=True, verbosity=1, sim_index=None):
         """The relaxation dispersion curve fitting grid search function.
 
-        @keyword lower:         The lower bounds of the grid search which 
must be equal to the number of parameters in the model.
-        @type lower:            array of numbers
-        @keyword upper:         The upper bounds of the grid search which 
must be equal to the number of parameters in the model.
-        @type upper:            array of numbers
-        @keyword inc:           The increments for each dimension of the 
space for the grid search. The number of elements in the array must equal to 
the number of parameters in the model.
-        @type inc:              array of int
-        @keyword constraints:   If True, constraints are applied during the 
grid search (eliminating parts of the grid).  If False, no constraints are 
used.
-        @type constraints:      bool
-        @keyword verbosity:     A flag specifying the amount of information 
to print.  The higher the value, the greater the verbosity.
-        @type verbosity:        int
-        @keyword sim_index:     The index of the simulation to apply the 
grid search to.  If None, the normal model is optimised.
-        @type sim_index:        int
+        @keyword lower:             The lower bounds of the grid search 
which must be equal to the number of parameters in the model.
+        @type lower:                array of numbers
+        @keyword upper:             The upper bounds of the grid search 
which must be equal to the number of parameters in the model.
+        @type upper:                array of numbers
+        @keyword inc:               The increments for each dimension of the 
space for the grid search. The number of elements in the array must equal to 
the number of parameters in the model.
+        @type inc:                  array of int
+        @keyword scaling_matrix:    The per-model list of diagonal and 
square scaling matrices.
+        @type scaling_matrix:       list of numpy rank-2, float64 array or 
list of None
+        @keyword constraints:       If True, constraints are applied during 
the grid search (eliminating parts of the grid).  If False, no constraints 
are used.
+        @type constraints:          bool
+        @keyword verbosity:         A flag specifying the amount of 
information to print.  The higher the value, the greater the verbosity.
+        @type verbosity:            int
+        @keyword sim_index:         The index of the simulation to apply the 
grid search to.  If None, the normal model is optimised.
+        @type sim_index:            int
         """
 
         # Minimisation.
-        self.minimise(min_algor='grid', lower=lower, upper=upper, inc=inc, 
constraints=constraints, verbosity=verbosity, sim_index=sim_index)
+        self.minimise(min_algor='grid', lower=lower, upper=upper, inc=inc, 
scaling_matrix=scaling_matrix, constraints=constraints, verbosity=verbosity, 
sim_index=sim_index)
 
 
     def map_bounds(self, param, spin_id=None):

Modified: branches/zooming_grid_search/specific_analyses/relax_fit/api.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/zooming_grid_search/specific_analyses/relax_fit/api.py?rev=24578&r1=24577&r2=24578&view=diff
==============================================================================
--- branches/zooming_grid_search/specific_analyses/relax_fit/api.py     
(original)
+++ branches/zooming_grid_search/specific_analyses/relax_fit/api.py     Mon 
Jul 21 09:14:00 2014
@@ -173,20 +173,20 @@
     def grid_search(self, lower=None, upper=None, inc=None, 
scaling_matrix=None, constraints=True, verbosity=1, sim_index=None):
         """The exponential curve fitting grid search method.
 
-        @keyword lower:         The per-model lower bounds of the grid 
search which must be equal to the number of parameters in the model.
-        @type lower:            list of lists of numbers
-        @keyword upper:         The per-model upper bounds of the grid 
search which must be equal to the number of parameters in the model.
-        @type upper:            list of lists of numbers
-        @keyword inc:           The per-model increments for each dimension 
of the space for the grid search.  The number of elements in the array must 
equal to the number of parameters in the model.
-        @type inc:              list of lists of int
+        @keyword lower:             The per-model lower bounds of the grid 
search which must be equal to the number of parameters in the model.
+        @type lower:                list of lists of numbers
+        @keyword upper:             The per-model upper bounds of the grid 
search which must be equal to the number of parameters in the model.
+        @type upper:                list of lists of numbers
+        @keyword inc:               The per-model increments for each 
dimension of the space for the grid search.  The number of elements in the 
array must equal to the number of parameters in the model.
+        @type inc:                  list of lists of int
         @keyword scaling_matrix:    The per-model list of diagonal and 
square scaling matrices.
         @type scaling_matrix:       list of numpy rank-2, float64 array or 
list of None
-        @keyword constraints:   If True, constraints are applied during the 
grid search (eliminating parts of the grid).  If False, no constraints are 
used.
-        @type constraints:      bool
-        @keyword verbosity:     A flag specifying the amount of information 
to print.  The higher the value, the greater the verbosity.
-        @type verbosity:        int
-        @keyword sim_index:     The index of the simulation to apply the 
grid search to.  If None, the normal model is optimised.
-        @type sim_index:        int
+        @keyword constraints:       If True, constraints are applied during 
the grid search (eliminating parts of the grid).  If False, no constraints 
are used.
+        @type constraints:          bool
+        @keyword verbosity:         A flag specifying the amount of 
information to print.  The higher the value, the greater the verbosity.
+        @type verbosity:            int
+        @keyword sim_index:         The index of the simulation to apply the 
grid search to.  If None, the normal model is optimised.
+        @type sim_index:            int
         """
 
         # Minimisation.




Related Messages


Powered by MHonArc, Updated Mon Jul 21 09:20:03 2014