Skip to content

jviquerat/sparkle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

514 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sparkle

logo

sparkle is a parametric, gradient-free optimization library that I mostly developed at CEMEF, in the CFL group (public repo from the team is here). It is designed to provide a common interface to various algorithms, and to make numerical experimentation easy.

If you end up using this library for research purpose, please consider citing the following paper (link):

Mixed-variable policy-based optimization
J. Viquerat
arXiv pre-print 2506.13240, 2025

Installation and usage

Clone this repository and install it locally. We recommend to use uv:

git clone git@github.com:jviquerat/sparkle.git
cd sparkle
uv venv
source .venv/bin/activate
uv pip install -r pyproject.toml
uv pip install -e .

Environments are expected to be available locally or present in the path. To train an agent on an environment, a .json case file is required (sample files are available in sparkle/env). Once you have written the corresponding <env_name>.json file to configure your agent, just run:

spk --train <json_file>

Analytical environments

Environment Default dimension Description Illustration
parabola 2 Classic parabola (solved with PBO) gif
rosenbrock 2 Rosenbrock function (solved with CMAES) gif
multi1d 1 Multi1D function (solved with EGO) gif
constraint 2 Parabola with a priori constraints on parameters (solved with CMAES) gif

Physics-based environments

Environment Default dimension Description Illustration
lorenz 4 Optimizing a control law for the chaotic Lorenz attractor, adapted from this ref (solved with PBO) gif
n-body 9 Optimizing the initial parameters to find periodic orbits, adapted from this ref (solved with CMAES) gif
heat-source 14 Optimizing the positions of heat sources to obtain a high temperature distribution with low variance in a target area (solved with CMAES) gif
packing 26 Finding the best disk packing within a square domain, adapted from this ref (solved with PBO) gif
emstack 40 Optimizing the reflectance of a dielectric mirror with mixed continuous/discrete variables (solved with PBO) gif

About

A gradient-free optimization library

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages