Skip to content

dschmitz89/ampgo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ampgo

Global optimization via adaptive memory programming with a scipy.optimize like API.

Installation

pip install ampgo

Example: Minimizing the six-hump camelback function in ampgo

import ampgo

def obj(x):
    """Six-hump camelback function"""
    x1 = x[0]
    x2 = x[1]
    f = (4 - 2.1*(x1*x1) + (x1*x1*x1*x1)/3.0)*(x1*x1) + x1*x2 + (-4 + 4*(x2*x2))*(x2*x2)
    return f

bounds = [(-5, 5), (-5, 5)]
res = ampgo.ampgo(obj, bounds)
print(res.x)
print(res.fun)

Documentation

For the full API reference check out the online documentation.

History

Coded by Andrea Gavana, andrea.gavana@gmail.com. Original hosted at https://code.google.com/p/ampgo/. Made available under the MIT licence. Usage and installation modified by Daniel Schmitz.

Differences compared to original version:

  • Support all of SciPy's local minimizers
  • Return a OptimizeResult class like SciPy's global optimizers
  • Require bounds instead of starting point
  • Jacobian and Hessian support
  • Support all of NLopt's local minimizers (requires simplenlopt)
  • Drop support for OpenOpt solvers as OpenOpt has been stale for several years