Did I find the right examples for you? yes no      Crawl my project      Python Jobs

# cogent.maths.scipy_optimize.fmin

All Samples(14)  |  Call(8)  |  Derive(0)  |  Import(6)

```        of the one scipy function that still needs to be removed
"""
from cogent.maths.scipy_optimize import fmin, brent
from cogent.util.array import scale_trace, norm_diff, \
has_neg_off_diags, sum_neg_off_diags, with_diag, without_diag
```
```                return abs(sum(diagonal(expm(q)(t)*freqs)) - similarity)
initial_guess = array([1.0])
result = fmin(similarity_f, initial_guess, disp=0)
#disp=0 turns off fmin messages
return result
```
```            return result
a = array(q)
xmin = fmin(func=err_f, x0=a, disp=0)
r = reshape(xmin, (4,3))
new_q = with_diag(r, -sum(r, 1))
```

```        of the one scipy function that still needs to be removed
"""
from cogent.maths.scipy_optimize import fmin, brent
from cogent.util.array import scale_trace, norm_diff, \
has_neg_off_diags, sum_neg_off_diags, with_diag, without_diag
```
```                return abs(sum(diagonal(expm(q)(t)*freqs)) - similarity)
initial_guess = array([1.0])
result = fmin(similarity_f, initial_guess, disp=0)
#disp=0 turns off fmin messages
return result
```
```            return result
a = array(q)
xmin = fmin(func=err_f, x0=a, disp=0)
r = reshape(xmin, (4,3))
new_q = with_diag(r, -sum(r, 1))
```

```from __future__ import division
from numpy import array
from cogent.maths.scipy_optimize import fmin

__author__ = "Antonio Gonzalez Pena"
```
```   param_guess = array(range(n_params))
for i in range(iterations):
xopt = fmin(f2min, param_guess, disp=0)
param_guess = xopt

```

```from __future__ import division
from numpy import array
from cogent.maths.scipy_optimize import fmin

__author__ = "Antonio Gonzalez Pena"
```
```   param_guess = array(range(n_params))
for i in range(iterations):
xopt = fmin(f2min, param_guess, disp=0)
param_guess = xopt

```

```#!/usr/bin/env python

from __future__ import division
import numpy, math, warnings
from cogent.maths.scipy_optimize import fmin_bfgs, fmin_powell, fmin, brent
```
```    def _minimise(self, f, x, **kw):
return fmin(f, x, **kw)

DefaultLocalOptimiser = Powell
```

```#!/usr/bin/env python

from __future__ import division
import numpy, math, warnings
from cogent.maths.scipy_optimize import fmin_bfgs, fmin_powell, fmin, brent
```
```    def _minimise(self, f, x, **kw):
return fmin(f, x, **kw)

DefaultLocalOptimiser = Powell
```