Giter Site home page Giter Site logo

sac's Introduction

SAC

Implementation of Soft Actor-Critic: Off-Policy Maximum Entropy Deep Reinforcement Learning with a Stochastic Actor

Added another branch for Soft Actor-Critic Algorithms and Applications -> SAC_V1.

Soft Q-Learning uses the following objective function instead of the conventional expected cumulative return:

J( \pi ) =  \sum_{t=0}^T  E_{( s_{t},  a_{t})  \sim{  \rho _{t} }} [r(s_{t},  a_{t}) +  \alpha H(.|s_{t})]

The entropy term is also maximized which have two major benefits:
  1. The exploration will be intelligently tuned and maximized as much as need, so the exploration/exploitation trade off is well satisfied.
  2. It prevent the learning procedure to get stuck in a local optima which results to a suboptimal policy.

Demos

Humanoid-v2 Walker2d-v2 Hopper-v2

Results

Humanoid-v2 Walker2d-v2 Hopper-v2

Dependencies

  • gym == 0.17.2
  • mujoco-py == 2.0.2.13
  • numpy == 1.19.1
  • psutil == 5.4.2
  • torch == 1.4.0

Installation

pip3 install -r requirements.txt

Usage

python3 main.py
  • You may use Train flag to specify whether to train your agent when it is True or test it when the flag is False.
  • There are some pre-trained weights in pre-trained models dir, you can test the agent by using them; put them on the root folder of the project and turn Train flag to False.

Environment tested

  • Humanoid-v2
  • Hopper-v2
  • Walker2d-v2
  • HalfCheetah-v2

Reference

  1. Soft Actor-Critic: Off-Policy Maximum Entropy Deep Reinforcement Learning with a Stochastic Actor, Haarnoja et al., 2018
  2. Soft Actor-Critic Algorithms and Applications, Haarnoja et al., 2018

Acknowledgement

All credits goes to @pranz24 for his brilliant Pytorch implementation of SAC.
Special thanks to @p-christ for SAC.py

sac's People

Contributors

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