Skip to content

A Python package for constrained Nelder-Mead optimization.

License

Notifications You must be signed in to change notification settings

alexblaessle/constrNMPy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

constrNMPy

A Python package for constrained Nelder-Mead optimization.

constrNMPy is a Python package that allows to use scipy's fmin function for constrained problems. It is a reimplementation of a popular matlab package.

Installation

Simply clone this repository via

git clone https://github.com/alexblaessle/constrNMPy.git

and install with

python setup.py install

Requirements

constrNMPy solely requires

  • numpy
  • scipy

Usage

Using constrNMPy is analogous to other scipy optimization functions, such as fmin. Let's say we want to optimize a rosenbrock function with a given range for x and y

# Define initial guess
x0=[2.5,2.5]

# Define lower and upper bounds (None indicates no bound)
LB=[2,2]
UB=[None,3]

# Call optimizer
import constrNMPy as cNM 
res=cNM.constrNM(cNM.test_funcs.rosenbrock,x0,LB,UB,full_output=True)

# Print results
cNM.printDict(res)

More examples are in constrNMPy/examples/.

Tests

To test constrNMPy, simply run

pytest constrNMPy/tests/

API

The API of can be found here .

About

A Python package for constrained Nelder-Mead optimization.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages