Skip to main content

Grid-restrained Nelder-Mead algorithm

Project description

GridNM

Grid-Restrained Nelder-Mead Algorithm

Description

Python implementation of grid-restrained variant of the Nelder-Mead algorithm, a derivative-free, unconstrained optimization algorithm that provably converges to a stationary point. See [1] for details.

This implementation has minimal dependencies and integrates well with the SciPy library. The code is fully typed, passes mypy, and comes with basic unit tests.

The MATLAB implementation [2] by the authors of [1] and the PyOPUS implementation [3] were used for reference. Variable names and default parameter were mostly taken from [1]. The adaptive parameters are as suggest in [4].

[1] Bűrmen, Árpád & Puhan, Janez & Tuma, Tadej. (2006). Grid Restrained Nelder-Mead Algorithm. Computational Optimization and Applications. 34. 359-375.

[2] https://fides.fe.uni-lj.si/~arpadb/software-grnm.html

[3] http://spiceopus.si/pyopus/doc/optimizer.grnm.html?highlight=grnm#module-pyopus.optimizer.grnm

[4] Gao, F. and Han, L. Implementing the Nelder-Mead simplex algorithm with adaptive parameters. 2012. Computational Optimization and Applications. 51:1, pp. 259-277.

Installation

GridNM can be installed from this repository. For example, using pip:

pip install git+https://gitlab.ets.org/rms/pdsm/testsecurity/gridnm

Getting Started

Here is an example of how to use gridnm to minimize the 2D rosenbrock function:

from gridnm import GridNM
from scipy.optimize import rosen

# initial point
x0 = [-1.2, 1]

# create solver instance
gridnm = GridNM(rosen, x0)

# run solver
sol = gridnm.solve()

# print solution
print(f"x_opt = {sol.x}")

See the comments in src/gridnm/gridnm.py for options and parameters.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gridnm-1.0.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

gridnm-1.0.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file gridnm-1.0.0.tar.gz.

File metadata

  • Download URL: gridnm-1.0.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for gridnm-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c4e82cc5e4dbf973ffe702df0f2545aca0797e5820a409dbb5561b6c70a4553e
MD5 7699a1b766b2d1ae2d1f6bfbba38c02e
BLAKE2b-256 ea62dd0d8858543e68e3ec566c5ff00606ebf1d584f9a4f7a1b0ead873a9fef2

See more details on using hashes here.

File details

Details for the file gridnm-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: gridnm-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for gridnm-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e90ad61ade18cfdbfd8c4ccbb7712b54516cd04faa28cd1c5dc045e9bc530ed
MD5 a1a6a5c5ce15fc39b606601d60aedfec
BLAKE2b-256 fea2104a90628fdfbe7da08841c730eb66d6a5701a75b091b40abe6c26e40c10

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page