Giter VIP home page Giter VIP logo

zihaozhouscut / quick-start-in-reinforcement-learning-algorithm Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 0.0 402 KB

This repository is a reproduction of the reinforcement learning algorithm I have learned. It is convenient to quickly understand the implementation and principle of the algorithm in combination with theory.

License: MIT License

Python 100.00%
dqn pytorch reinforcement-learning a2c reinforce ppo

quick-start-in-reinforcement-learning-algorithm's Introduction

Quick Start in Reinforcement Learning Algorithm

Introduction

This repository is a reproduction of the reinforcement learning algorithm I have learned. It is convenient to quickly understand the implementation and principle of the algorithm in combination with theory. Due to the difficulty in obtaining the system model in practice, the algorithms to be implemented in this repository mainly focus on model-free algorithms, including value-based methods, policy-based methods and actor-critic methods. image

Install

This project is based on Pytorch 1.2.0

Results

The following figure shows the convergence of DQN in the Cartpole-v0 environment, it can be found that after 400 episodes, reward has converged to the maximum of 200, indicating that DQN has achieved good results in this task. image

The following picture shows the convergence of REINFORCE in the Cartpole-v0 environment, since REINFORCE is based on MC, the variance of the estimation is relatively large, which makes the fluctuation of reward more significant.In addition, we note that the episode required for the reward convergence of REINFORCE algorithm to the highest score is much more than that of DQN (1000 vs 400), because REINFORCE will update the network parameters only after an episode is completed.

image

Next is the convergence of A2C in the Cartpole-v0 environment. During the experiment, it was found that the effect of updating the network with all the data after one episode was better than training with separate sample after each action, and the convergence effect was also more stable. At the same time, we find that compared with REINFORCE algorithm, the reward jitter of A2C is smaller, indicating that the introduction of baseline reduces the variance of the algorithm.

image

The episode return of PPO-Clip is shown in the next picture. It can be seen that the jitter of return is significantly lower than that of A2C.

image

quick-start-in-reinforcement-learning-algorithm's People

Contributors

zihaozhouscut avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

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