LDNN97 / Evolutionary-Optimization-Algorithms

DE, CMA-ES, MA-ES, LM-MAES Python Implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Evolutionary Optimization Algorithms

Build Status codecov

Papers:

DE: Differential evolution–a simple and efficient heuristic for global optimization over continuous spaces

CMA-ES: The CMA Evolution Strategy: A Tutorial

Restart CMA-ES: A Restart CMA Evolution Strategy With Increasing Population Size

MA-ES: Simplify your covariance matrix adaptation evolution strategy

LM-CMA: LM-CMA: An alternative to L-BFGS for large-scale black box optimization

LM-MA: Large Scale Black-box Optimization by Limited-Memory Matrix Adaptation

ES for RL: Evolution Strategies as A Scalable Alternative to Reinforcement Learning

Usage

  1. clone the repository

  2. import eoa

  3. select a problem already existed or define your only problem

  4. select an algorithm to find the optimum.

You can look into eoa.py to find more information about the usage.

Example

TaskProb = Sphere(50, -50, 50)
Task = DE(TaskProb, 1000)
Task.run()

Class for optimizer

class Optimizer(object):
    def __init__(self, func, maxgen, *arg1, **arg2):
        """
        initialize attributes of the instance
        :argument
            self.f : problems to be solved
            self.count : max generation number
            self.opti_x : optimal solution
            self.opti_f : optimal value
        """
        self.f = func
        self.maxgen = maxgen
        self.opti_x = []
        self.opti_f = 1e10

    def step(self):
        """
        a single step of the evolution process
        """
        pass

    def run(self):
        """
        control the generation number
        """
        pass

    def output(self):
        """
        return the solution and optimal value
        return:
            self.opti_x, self.opti_f
        """
        pass

Class for problem

class Problem(object):
    def __init__(self, dim, lb, up, *arg1, **arg2):
        """
        initialize attributes of the problem
        :argument
            D : Dimension
            lb : lower bound
            ub : upper bound
        """
        self.D = dim
        self.lb = lb
        self.ub = up

    def evaluate(self, x):
        """
        define the evaluate methods
        :argument
            x : input
        """
        pass

About

DE, CMA-ES, MA-ES, LM-MAES Python Implementation

License:MIT License


Languages

Language:Python 100.0%