Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jihoonerd/rl-maze

Simple maze solver by reinforcement learning
https://github.com/jihoonerd/rl-maze

maze policy-gradient q-learning reinforce reinforcement-learning sarsa tutorial

Last synced: 2 months ago
JSON representation

Simple maze solver by reinforcement learning

Awesome Lists containing this project

README

        

# rl-maze

## Description

Repository for learning basic concept of reinforcement learning.

This provides following approaches to solve maze.

* Random walk
* Policy gradient (REINFORCE)
* Sarsa
* Q-learning

## How to use

* Instantiate Q-learning agent and train:

```python
agent = Agent('q') # should be one of ['randwalk', 'pg', 'sarsa', 'q']
agent.train()
```

* Draw agent's move by using `agent.state_history`:

```python
maze = Maze()
maze.save_animation('maze.gif', agent.state_history) # it requires imagemagick
```