Commit a6f4c2dd authored by Theo Steininger's avatar Theo Steininger

Generalized minimizer in pipeline.

parent cd23003d
...@@ -224,7 +224,8 @@ class Pipeline(Loggable, object): ...@@ -224,7 +224,8 @@ class Pipeline(Loggable, object):
# let all other nodes listen for likelihood evaluations # let all other nodes listen for likelihood evaluations
self._listen_for_likelihood_calls() self._listen_for_likelihood_calls()
def find_minimum(self, starting_guess=None, **kwargs): def find_minimum(self, starting_guess=None, method='Nelder-Mead',
**kwargs):
if starting_guess is None: if starting_guess is None:
starting_guess = np.zeros(len(self.active_variables)) + 0.5 starting_guess = np.zeros(len(self.active_variables)) + 0.5
...@@ -235,9 +236,10 @@ class Pipeline(Loggable, object): ...@@ -235,9 +236,10 @@ class Pipeline(Loggable, object):
z, z,
len(self.active_variables), len(self.active_variables),
len(self.active_variables)) len(self.active_variables))
minimum = optimize.fmin(func=call_func, minimum = optimize.minimize(func=call_func,
x0=starting_guess, x0=starting_guess,
**kwargs) method=method,
**kwargs)
self.logger.info("Minimizer finished.") self.logger.info("Minimizer finished.")
for i in xrange(1, size): for i in xrange(1, size):
self.logger.debug("Sending DIE_TAG to rank %i." % i) self.logger.debug("Sending DIE_TAG to rank %i." % i)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment