Skip to content

yaricom/RL-playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RL-playground

In this repository some of my experiments with Reinforcement Learning algorithms based on OpenAi Gym ToolKit

Overview

Packages:

Environments:

Learning agents:

  • SampleAverageActionValueAgent - the learning agent based on sample-average action-value selection algorithm for both stationary and nonstationary environments

Usage

import gym

from openai.agents.sampleaverage import SampleAverageActionValueAgent

def main():
    # load environment
    env = gym.make('10ArmedBanditStationary-v0')

    # setup
    agent = SampleAverageActionValueAgent(num_actions = 10)
    episode_count = 1
    max_steps = 100
    reward = 0
    done = False

    for i in xrange(episode_count):
        ob = env.reset()

        for j in xrange(max_steps):
            action = agent.evaluate(reward, done)
            ob, reward, done, _ = env.step(action)
            if done:
                break


if __name__ == '__main__':
    main()

About

The RL playground. Experiments with RL algorithms

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages