GithubHelp home page GithubHelp logo

fszewczyk / rocket-landing-rl Goto Github PK

View Code? Open in Web Editor NEW
13.0 3.0 3.0 2.55 MB

Custom OpenAI Gym for vertical rocket landing and Deep Q-Learning implementation.

Home Page: https://pypi.org/project/rocketgym/

License: Other

Python 100.00%
deep-q-learning deep-q-network q-learning reinforcement-learning rocket-landing thrust-vector-control

rocket-landing-rl's Introduction

Part of SHKYERA project

background Rocket landing

Rocket Landing - Reinforcement Learning

Environment

I made a custom OpenAI-Gym environment with fully functioning 2D physics engine. If you want to test your own algorithms using that, download the package by simply typing in terminal:

pip install rocketgym

All the environment's functionalities are described here.

Minimal usage

Make sure that all dependencies are installed by pip install -r requirements.txt

from rocketgym.environment import Environment

import random

env = Environment()
observation = env.reset()
done = False

while not done:
    observation, reward, done, info = env.step(random.randint(0,3))
    env.render()

Learning

python3 train.py -h
usage: Rocket Landing - Reinforcemeng Learning [-h] [--curriculum] [--softmax] [--save] [-model MODEL]

optional arguments:
  -h, --help    show this help message and exit
  --curriculum  Use Curriculum Learning
  --softmax     Use Softmax exploration instead of eps-greedy
  --save        Save flight logs and models every 100 episodes
  -model MODEL  Path to the model to load. Overrides the curriculum and exploration
                settings. Renders the scene from the start.

In the train.py you can see, how agent training is implemented. All you need to do is specify the exploration strategy and adjust the environment to your needs. I found that it takes around 2000 iterations to learn to land without any curriculum learning, but the process can be significantly sped up by setting up a task difficulty schedule. This can be easily done through the Curriculum module.

Diagnostics

If you want to make pretty plots, like this one pretty plot feel free to use diagnostics.py. All you need to know to do that is described in the script itself.

For a detailed explanation of the environment and the learning algorithms I used, see here.

rocket-landing-rl's People

Contributors

dependabot[bot] avatar draichi avatar fszewczyk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rocket-landing-rl's Issues

Integrating pytorch

Tasks:

  • Learn PyTorch
  • Design network
  • Create test environment
  • Test basic learning
  • Design learning process
  • Validate learning process

Physics Engine

Tasks:

  • Linear Dynamics
  • Rotation around arbitrary axis
  • Angular Dynamics

Visualization

Tasks:

  • Design a matplotlib dashboard
  • Pygame integration showing a flight
  • Implement different models

Report

Tasks:

  • Run multiple tests
  • Run statistical tests on results
  • Write report

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.