GithubHelp home page GithubHelp logo

fiver01 / sac-continuous-pytorch_fork Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xinjinghao/sac-continuous-pytorch

0.0 0.0 0.0 6.39 MB

a clean and robust Pytorch implementation of SAC on continuous action space

License: MIT License

Python 100.00%

sac-continuous-pytorch_fork's Introduction

SAC-Continuous-Pytorch

I found the current implementation of Soft Actor Critic on continuous action space is somewhat complicated, which is hard to get start.
And this is a clean and robust Pytorch implementation of SAC on continuous action space. Here is the result:

avatar
All the experiments are trained with same hyperparameters recommended by Haarnoja et al.

The gif below is a short record of the performance on BipedalWalkerHardcore-v3: avatar

Dependencies

gym==0.18.3
box2d==2.3.10
numpy==1.21.2
pytorch==1.8.1
tensorboard==2.5.0

How to use my code

Train from scratch

run 'python main.py', where the default enviroment is Pendulum-v0.

Change Enviroment

If you want to train on different enviroments, just run 'python main.py --EnvIdex 0'.
The --EnvIdex can be set to be 0~5, where
'--EnvIdex 0' for 'BipedalWalker-v3'
'--EnvIdex 1' for 'BipedalWalkerHardcore-v3'
'--EnvIdex 2' for 'LunarLanderContinuous-v2'
'--EnvIdex 3' for 'Pendulum-v0'
'--EnvIdex 4' for 'Humanoid-v2'
'--EnvIdex 5' for 'HalfCheetah-v2'

P.S. if you want train on 'Humanoid-v2' or 'HalfCheetah-v2', you need to install MuJoCo first.

Play with trained model

run 'python main.py --EnvIdex 1 --write False --render True --Loadmodel True --ModelIdex 2800000', which will render the 'BipedalWalkerHardcore-v3'.

Visualize the training curve

You can use the tensorboard to visualize the training curve. History training curve is saved at '\runs'

Hyperparameter Setting

For more details of Hyperparameter Setting, please check 'main.py'

Reference

Soft Actor-Critic Algorithms and Applications

Other RL algorithms by Pytorch can be found here.

sac-continuous-pytorch_fork's People

Contributors

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