• Stars
    star
    143
  • Rank 257,007 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created over 6 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

OpenAI's cartpole env solver.

Cartpole

Reinforcement Learning solution of the OpenAI's Cartpole.

Check out corresponding Medium article: Cartpole - Introduction to Reinforcement Learning (DQN - Deep Q-Learning)

About

A pole is attached by an un-actuated joint to a cart, which moves along a frictionless track. The system is controlled by applying a force of +1 or -1 to the cart. The pendulum starts upright, and the goal is to prevent it from falling over. A reward of +1 is provided for every timestep that the pole remains upright. The episode ends when the pole is more than 15 degrees from vertical, or the cart moves more than 2.4 units from the center. source

DQN

Standard DQN with Experience Replay.

Hyperparameters:

  • GAMMA = 0.95
  • LEARNING_RATE = 0.001
  • MEMORY_SIZE = 1000000
  • BATCH_SIZE = 20
  • EXPLORATION_MAX = 1.0
  • EXPLORATION_MIN = 0.01
  • EXPLORATION_DECAY = 0.995

Model structure:

  1. Dense layer - input: 4, output: 24, activation: relu
  2. Dense layer - input 24, output: 24, activation: relu
  3. Dense layer - input 24, output: 2, activation: linear
  • MSE loss function
  • Adam optimizer

Performance

CartPole-v0 defines "solving" as getting average reward of 195.0 over 100 consecutive trials. source

Example trial gif

Example trial chart

Solved trials chart

Author

Greg (Grzegorz) Surma

PORTFOLIO

GITHUB

BLOG

More Repositories

1

style_transfer

CNN image style transfer ๐ŸŽจ.
Jupyter Notebook
272
star
2

atari

AI research environment for the Atari 2600 games ๐Ÿค–.
Python
247
star
3

image_generator

DCGAN image generator ๐Ÿ–ผ๏ธ.
Jupyter Notebook
214
star
4

face_generator

DCGAN face generator ๐Ÿง‘.
Jupyter Notebook
200
star
5

image_classifier

CNN image classifier implemented in Keras Notebook ๐Ÿ–ผ๏ธ.
Jupyter Notebook
178
star
6

text_predictor

Char-level RNN LSTM text generator๐Ÿ“„.
Python
113
star
7

slitherin

AI research environment for the game of Snake ๐Ÿ .
Python
90
star
8

jetson

Self-driving AI toy car ๐Ÿค–๐Ÿš—.
Jupyter Notebook
80
star
9

metal_camera

iOS metal camera with GPU shaders.
Swift
73
star
10

pixelizator

Swift/Python image pixelizer ๐Ÿ–ผ๏ธ.
Swift
68
star
11

deep_traffic

MIT DeepTraffic top 2% solution (75.01 mph) ๐Ÿš—.
JavaScript
56
star
12

password_cracker

Char-level RNN LSTM password cracker ๐Ÿ”‘๐Ÿ”“.
55
star
13

stereo_depth_estimator

Stereo depth estimation for self-driving cars ๐Ÿš—
Python
49
star
14

edge_detector

HED real-time iOS edge detector.
Swift
43
star
15

deep_dream

DeepDream psychodelic image generator.
Python
39
star
16

sliding_puzzle

Swift implementation of the Sliding Puzzle game with Iterative Deepening A* AI Solver.
Swift
35
star
17

street_lanes_finder

Street lanes finder for self-driving cars๐Ÿš—.
Jupyter Notebook
34
star
18

gsurma.github.io

Greg's Portfolio ๐ŸŒŽ.
HTML
31
star
19

digit_recognizer

CNN digit recognizer implemented in Keras Notebook, Kaggle/MNIST (0.995).
Jupyter Notebook
30
star
20

meta_intelligence

AI research environment for program generation.
Python
27
star
21

histopathologic_cancer_detector

CNN histopathologic tumor identifier.
Jupyter Notebook
27
star
22

mono_depth_estimator

Mono depth estimation for self-driving cars ๐Ÿš—
Jupyter Notebook
24
star
23

image_tagger

CNN multi-label image classifier ๐Ÿ–ผ๏ธ.
Jupyter Notebook
20
star
24

twitter_data_parser

Python scripts that download metadata and tweets for given users.
Python
18
star
25

prison_escape

Prisoner's Dilemma research environment.
Jupyter Notebook
16
star
26

cnn_explainer

Making CNNs interpretable.
Jupyter Notebook
15
star
27

newstagram

Simple iOS news feed app where you can customize categories and regions.
Swift
15
star
28

diffie_hellman_key_exchange

Swift implementation of classic cryptographic key exchange method.
Swift
15
star
29

prime_numbers_generator

Eratosthenes Sieve based prime numbers generator written in Swift.
Swift
11
star
30

sleepless_mac

Status bar app that prevents your mac from sleeping.
Swift
10
star
31

rpi_lcd_system_monitoring

Python scripts that display sytem data on i2c LCD screen.
Python
7
star
32

pong

iOS implementation of the classic Atari Pong game.
Swift
6
star
33

xcode_project_cleaner

Shell script that quickly cleans up xcode project.
Shell
6
star
34

game_of_life

NetLogo implementation of Conway's Game Of Life.
NetLogo
6
star
35

github_feed

Visually simple yet powerful github feed app.
Swift
4
star
36

stellar

Astronomy Photo of the Day ๐Ÿš€.
Swift
4
star
37

gsurma

3
star