Code Monkey home page Code Monkey logo

pbo's Introduction

Policy-based optimization

logo

PBO (policy-based optimization) is a degenerate policy gradient algorithm used for black-box optimization. It shares common traits with both DRL (deep reinforcement learning) policy gradient methods, and ES (evolution strategies) techniques. In this repository, we present a parallel PBO algorithm with full covariance matrix adaptation, along with a few demonstrative applications. The related pre-print can be found here and the formal paper here. This paper formalizes the approach used in previous related works:

  • Direct shape optimization through deep reinforcement learning (paper, pre-print and github repository),
  • Single-step deep reinforcement learning for open-loop control of laminar and turbulent flows (paper and pre-print),
  • Deep reinforcement learning for the control of conjugate heat transfer with application to workpiece cooling (paper and pre-print)

Installation and usage

After cloning the package, just cd inside the folder and install using:

pip install -e .

The environments from the paper are available in the envs/* folder. For each .py environment file, you need a .json parameter file located in the same directory. To run an environment, just use:

pbo path/to/envs/my_env.json

Below are some selected optimization cases performed with the algorithm.

Function minimization

Simple minimum-finding on textbook analytical functions (see more in the paper).

Parabola function

We consider the minimization on a parabola defined in [-5,5]x[-5,5]. Below is the course of a single run, generation after generation, with a starting point in [2.5,2.5]:

Rosenbrock function

The Rosenbrock function is here defined in [-2,2]x[-2,2]. It contains a very narrow valley, with a minimum in [1,1]. The shape of the valley makes it a hard optimization problem for many algorithms. Here is the course of a single run, generation after generation, with a starting point in [0.0,-1.0]:

Packing

Optimal packing of geometrical shapes (see here for much, much more). The goal is to pack unit shapes in the square of smallest side. Most solutions are already known.

Environment Description
6 circles in square (12 degrees of freedom): the optimal value is s = 5.328+, best PBO result was s = 5.331 after 800 generations.
10 circles in square (20 degrees of freedom): the optimal value is s = 6.747+, best PBO result was s = 6.754 after 1000 generations
3 equilateral triangles in square (9 degrees of freedom): the optimal value is s = 1.478+, best PBO result was s = 1.478+ after 1000 generations
5 equilateral triangles in square (15 degrees of freedom): the optimal value is s = 1.803+, best PBO result was s = 1.807+ after 2500 generations

Parametric control laws

Chaotic Lorenz attractor

We consider the equations of the Lorenz attractor with a velocity-based control term:

We make use of the following non-linear control with four free parameters:

Two control cases are designed: the first one consists in forcing the system to stay in the x<0 quadrant, while the second one consists in maximizing the number of sign changes (cases inspired from this thesis). Below is a comparison between the two controlled cases.

pbo's People

Contributors

aurelegoetz avatar jviquerat 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.