Skip to main content

About

Compact implementation of Evolution Strategies using MPI, together with an MPI-based wrapper for the `cmaes' Python library (only parallelizing the function evaluations). This repository uses part of the code from OpenAI's implementation (https://github.com/openai/evolution-strategies-starter).

Example usage:

from esmpi import ES_MPI

def eval_fn(x):
    time.sleep(0.01)
    return (x[0] - 3) ** 2 + (10 * (x[1] + 2)) ** 2

optimizer = ES_MPI(n_params=2, population_size=16, learning_rate=0.1, sigma=0.02)

for i in range(50):
    fit = optimizer.step(eval_fn)

    if optimizer.is_master == 0:
        print(f"{i}: fitness {np.mean(fit)}, current best params {optimizer.get_parameters()}\n")

Metadata

Release files for esmpi 1.0

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

Source distribution (sdist)

Source distribution for esmpi 1.0
File Size Uploaded
esmpi-1.0.tar.gz 11.3 kB Details

Built distribution (wheel)

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

Total release size: 23.7 kB

Release files / esmpi-1.0.tar.gz

Download URL esmpi-1.0.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b266c75487531d68cc504794bafa3d7e8c6a065aa03282f58fb6b0ae511b6720
BLAKE2b-256 checksum
How to use checksums
6efaf1d674104bf374479e2766aa8021ef0c87c2ee0386447827108dd3c9a363
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.9

Release files / esmpi-1.0-py3-none-any.whl

Download URL esmpi-1.0-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a6c1c0e078ce38c45a71c61e1974305d731bef7312762b033a4cd12743eb299
BLAKE2b-256 checksum
How to use checksums
c97fba8ca1bf74fe097d6fd259a0bc528820d7a410e2752c9f125b58b39eeb66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.9

Release history Release notifications | RSS feed

This release

1.0 This release

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