In this repository some of the most popular reinforcement learning approaches are implemented. They all follow the structure of one abstract agent, in such a way, that helper functions to compare agents can be used on all instances. These are meant to serve as a learning and comparison tool.
- Agents
- Environments
- Experiments
- Helper Functions in: utils and train
Examples of usage can be found in /experiments as well as an explanation for those.
Creating an environment with gym.make(<gymid>)
or by importing environment from /environnments
where all the working
envs are imported.
from environments import FrozenLakeEnv
env = FrozenLakeEnv(map_name='8x8')
To test some reinforcement learning methods, you can either implement your own method and comply with the abstract_agent
from rl_methods
. With their class implementation it is also described, for what type of environment they should
work.
from agents import SarsaAgent, QLearningAgent
sarsa_agent = SarsaAgent(env)
q_learning_agent = QLearningAgent(env)
To train those agents and to visualise the statistics that emerged during training,
functions from /train
and /utils
are used.
from train import train_agents
from utils import visualize_training_results_for_agents
stats = train_agents(env, [sarsa_agent, q_learning_agent])
visualize_training_results_for_agents(stats)