Skip to main content

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 is available on PyPI and can be installed, for example, using pip:

pip install 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.

Metadata

Release files for gridnm 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gridnm 1.0.1
File Size Uploaded
gridnm-1.0.1.tar.gz 8.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gridnm 1.0.1
File Interpreter ABI Platform
gridnm-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 16.2 kB

Release files / gridnm-1.0.1.tar.gz

Download URL gridnm-1.0.1.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f1c63c85c4cc5ea620ee6d9f57525a255155cdd4ebc9734a0c260e47080ac1ad
BLAKE2b-256 checksum
How to use checksums
0e10257f3aa42e9c089283005c2548f2565ed0a60fc7796b6adfe60e7756bcd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.6

Release files / gridnm-1.0.1-py3-none-any.whl

Download URL gridnm-1.0.1-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
329d764e2410a066577480342586baab13ff8b994a95a058d761a69d3f89872a
BLAKE2b-256 checksum
How to use checksums
c15820b2a2ab966ca5530b82d8a954a18ab7f9fc60f364869e9d75782340d2a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.6

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page