• Stars
    star
    177
  • Rank 209,705 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created over 3 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A library that makes Evolutionary Strategies (ES) simple to use.

EvoStrat

A library that makes Evolutionary Strategies (ES) simple to use.

Installation

pip install evostrat

Usage

pop = PopulationImpl(...) # See complete examples for implementations. 
optim = torch.optim.Adam(pop.parameters()) # Use any torch.optim optimizer
for i in range(N):
    optim.zero_grads()
    pop.fitness_grads(n_samples=200) # Computes approximate gradients
    optim.step()

For complete examples that solves 'LunarLander-v2' see the examples/.

Lunar lander

Description

Evolutionary Strategies is a powerful approach to solve reinforcement learning problems and other optimization problems where the gradients cannot be computed with backprop. See "Evolution strategies as a scalable alternative to reinforcement learning" for an excellent introduction.

In ES the objective is to maximize the expected fitness of a distribution over individuals, referred to as the population. With a few math tricks this objective can be maximized with gradient ascent, even if the fitness function itself is not differentiable.

This library offers

  1. A flexible and natural interface for ES that cleanly separates the environment, the reinforcement learning agent, the population distribution and the optimization.
  2. A plug-and-play approach for reinforcement learning agents with torch.nn.Module policy networks. See examples/lunar_lander.py and examples/normal_lunar_lander.py.
  3. Several population distributions and variants
    1. Independent Normal. equivalent to OpenAI ES or PEPG depending on whether the standard deviation is fixed or learned. See examples/normal_lunar_lander.py
    2. Multivariate Normal with a full covariance matrix. Similar to CMA-ES. See examples/multivariate_normal_lunar_lander.py
    3. Categorical. For agents with categorical parameters, demonstrating the ability to handle non-normal distributions. See the examples/binary_lunar_lander.py.
  4. A simple interface for creating your own populations, without having to derive any gradients! Just subclass Population and implement the sampling process. See the built in populations for inspiration.

Attribution

If you use this software in your academic work please cite

@misc{palm2020,
  author = {Palm, Rasmus Berg},
  title = {EvoStrat},
  year = {2020},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/rasmusbergpalm/evostrat}}
}

More Repositories

1

DeepLearnToolbox

Matlab/Octave toolbox for deep learning. Includes Deep Belief Nets, Stacked Autoencoders, Convolutional Neural Nets, Convolutional Autoencoders and vanilla Neural Nets. Each method has examples to get you started.
MATLAB
3,773
star
2

jslate

Write your dashboards in pure html/js
PHP
244
star
3

recurrent-relational-networks

Code accompanying the paper Recurrent Relational Networks for Complex Relational Reasoning https://arxiv.org/abs/1711.08028
Python
202
star
4

vnca

Python
42
star
5

e2e-ie-release

Code accompanying End-to-End Information Extraction without Token-Level Supervision
Python
37
star
6

nanograd

A miniscule implementation of reverse mode auto-differentiation
Python
26
star
7

collectd-php

php class to send stats to collectd
PHP
19
star
8

attend-copy-parse

Code for the paper attend, copy, parse - End-to-end information extraction from documents (https://arxiv.org/pdf/1812.07248.pdf)
Python
13
star
9

pytorch-lgssm

A Linear Gaussian State Space Model (LGSSM) for pytorch, also known as a Linear Dynamical System (LDS)
Python
13
star
10

shapeguard

ShapeGuard allows you to very succinctly assert the expected shapes of tensors in a dynamic, einsum inspired way
Python
8
star
11

normalization

A seq2seq model for date parsing. Just for fun.
Python
8
star
12

hebbian-evolution

Python
7
star
13

screeps

6
star
14

nomnom

nomnom is a troll that lives off bits, a so called data-troll. Feed him and keep him happy :)
PHP
5
star
15

Trails

Trails is a plugin for piwik that visualizes user navigation patterns
PHP
4
star
16

pymc3-quap

Quadratic Approximation for PyMC3
Python
4
star
17

bayes-applied-stats

2
star
18

event.ly

Super simple events + invites
PHP
2
star
19

observer

beep... beep...
JavaScript
1
star
20

AESpad

AESpad is an encrypted chat service using a javascript implementation of AES and a pre-shared key.
PHP
1
star