| Trees | Indices | Help |
|
|---|
|
|
A class that implements a optimizer.
| Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
| Class Variables | |
__doc__ = """A class that implements a optimiz
|
|
LOG_NAME =
|
|
| Instance Variables | |
|
T simulated annealing temperature. |
|
|
active vector of which parameters to optimize. |
|
|
constrain a function that constrains the step. |
|
|
deriv_quantum minimum step size used in differentiation. |
|
|
scale estimate of the step size to use in differentiation. |
|
|
sem a semaphore to control the number of threads to use (if you want to set the # of threads do self.sem = semclass(nnn)). |
|
| Method Details |
Create an optimizer object. You can also set the following variables
between calls to self.step():
|
Set the number of simultaneous threads to be allowed. Calculations of the residuals are farmed out to threads. |
Take one simulated annealing step, as fast as possible. We send all the processors in random directions, and the one that reports an acceptable step first is returned. Returns 1 on success, 0 if no good step could be found in a reasonable number of tries. The temperature can also be a function of one argument (as an alternative to a float), in which case, the temperature is calculated as T(self). |
Returns number between 0 and 1 if the optimization seems finished. Returns -1 if it's clearly not done yet. This is designed to be called after step(), so that both self.p and self.last_p refer to the results of downhill steps. |
This is an underestimate of covariance. Adding in the self.lamb term means that it attempts to correct for the nonlinearity of the problem, at least along the direction of search. |
This is the normal top-level routine. You should feel free to make your own, though. |
| Class Variable Details |
__doc__
|
| Instance Variable Details |
activevector of which parameters to optimize. Only the active parameters change their value. |
constraina function that constrains the step. You can use it to do a constrained fit by having it project the proposed step back into the legal volume. Called as self.constrain(old_prms, proposed_prms, self.args). It returns the constrained step, or None if there isn't any. |
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Thu Sep 22 04:25:09 2011 | http://epydoc.sourceforge.net |