Mehrdadghassabi / frozenlake_RL_solutions

different reinforcement learning approach for solving frozenlake game

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

frozenlake_RL_solutions

Here i put my implemention of reinforcement learning based solutions for the frozenlake game.

  • install required packages with
    pip install -r requirement.txt

Q-learning

q learning is a model-free off-policy reinforcement learning algorithm.

  • training q table : first uncomment this line in the main.py
    qlearning.train(episode_number, max_steps, alpha, gamma, epsilon, decay_rate, render_mode, desc)

then run main.py

    python main.py

it takes few minutes because it is training the q-table using qlearning.py

SARSA

Sarsa is a model-free on-policy reinforcement learning algorithm.

  • training q table : same as the q-learning first uncomment this line in the main.py
    Sarsa.train(episode_number, max_steps, alpha, gamma, epsilon, decay_rate, render_mode)

then run main.py

    python main.py

it also takes few minutes because it is training the q-table using Sarsa.py

Monte-Carlo

we can also use Monte-Carlo method for solving it.

  • training q table : same as the two last approach uncomment this line in the main.py
    Monte_Carlo.train(episode_number, max_steps, epsilon, decay_rate, render_mode)

then run main.py

    python main.py

it also takes few minutes because it is training the q-table using Monte_Carlo.py

render mode

as training runs 100000 episode of the game its not wise to visualize all of them during the training, in order to do so set the render mode to rgb_array in the main.py

    render_mode = "rgb_array"

but if you want to see what happen set it to human

    render_mode = "human"

About

different reinforcement learning approach for solving frozenlake game


Languages

Language:Python 100.0%