项目作者: optimization-toolbox

项目描述 :
DNE4py is a python library that aims to run and visualize many different evolutionary algorithms with high performance using mpi4py. It allows easy evaluation of evolutionary algorithms in high dimension (e.g. neural networks for reinforcement learning)
高级语言: Python
项目地址: git://github.com/optimization-toolbox/DNE4py.git
创建时间: 2020-06-04T05:35:14Z
项目社区:https://github.com/optimization-toolbox/DNE4py

开源协议:GNU General Public License v3.0

下载


DNE4py: Deep-Neuroevolution with mpi4py

Status: Maintenance (expect bug fixes and major updates)

DNE4py is a python library that aims to run and visualize many different evolutionary algorithms with high performance using mpi4py. It allows easy evaluation of evolutionary algorithms in high dimension (e.g. neural networks for reinforcement learning)

Implementation available:

Installation

  1. foo@bar:~$ git clone https://github.com/optimization-toolbox/DNE4py
  2. foo@bar:~$ cd deep-neuroevolution-mpi4py/
  3. foo@bar:~$ python3 -m pip install -e .

Running

Create main.py:

  1. from DNE4py.optimizers.deepga import TruncatedRealMutatorGA
  2. def objective(x):
  3. result = np.sum(x**2)
  4. return result
  5. initial_guess = [1.0, 1.0]
  6. optimizer = TruncatedRealMutatorGA(objective=objective,
  7. initial_guess=initial_guess,
  8. workers_per_rank=10,
  9. num_elite=1,
  10. num_parents=3,
  11. sigma=0.01,
  12. seed=100,
  13. save=1,
  14. verbose=1,
  15. output_folder='results/experiment')
  16. optimizer(100)

Execute main.py (relies on MPI):

  1. foo@bar:~$ mpiexec -n 4 python3 main.py

This will create a result folder based on output_folder

DeepGA

DeepGA: population over generations

CMA-ES

CMA-ES: population over generations

RandomSearch

RandomSearch: population over generations

Post-processing

You can import and generate some visualizations:

  1. from DNE4py import load_mpidata, get_best_phenotype, get_best_phenotype_generator