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: 6 months ago
JSON representation
Simple maze solver by reinforcement learning
- Host: GitHub
- URL: https://github.com/jihoonerd/rl-maze
- Owner: jihoonerd
- Created: 2019-05-19T03:29:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-04-27T15:28:38.000Z (over 1 year ago)
- Last Synced: 2025-03-26T14:50:33.605Z (7 months ago)
- Topics: maze, policy-gradient, q-learning, reinforce, reinforcement-learning, sarsa, tutorial
- Language: Python
- Homepage:
- Size: 1.54 MB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```