Giter VIP home page Giter VIP logo

yabox's Introduction

DOI

Yet another black-box optimization library for Python

Description

Yabox is a very small library for black-box (derivative free) optimization of functions that only depends on numpy and matplotlib for visualization. The library includes different stochastic algorithms for minimizing a function f(X) that does not need to have an analytical form, where X = {x1, ..., xN}. The current version of the library includes the Differential Evolution algorithm and a modified version for parallel evaluation.

Example of minimization of the Ackley function (using Yabox and Differential Evolution):

Ackley Function

Installation

Yabox is in PyPI so you can use the following command to install the latest released version:

pip install yabox

Basic usage

Pre-defined functions

Yabox includes some default benchmark functions used in black-box optimization, available in the package yabox.problems. These functions also include 2D and 3D plotting capabilities:

>>> from yabox.problems import Levy
>>> problem = Levy()
>>> problem.plot3d()

Levy Function

A problem is just a function that can be evaluated for a given X:

>>> problem(np.array([1,1,1]))
0.80668910823394901

Optimization

Simple example minimizing a function of one variable x using Differential Evolution, searching between -10 <= x <= 10:

>>> from yabox import DE
>>> DE(lambda x: sum(x**2), [(-10, 10)]).solve()
(array([ 0.]), 0.0)

Example using Differential Evolution and showing progress (requires tqdm)

Optimization example

About

This library is inspired in the scipy's differential evolution implementation. The main goal of Yabox is to include a larger set of stochastic black-box optimization algorithms plus many utilities, all in a small library with minimal dependencies.

yabox's People

Contributors

elc avatar pablormier avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.