mathisfederico / learnrl Goto Github PK
View Code? Open in Web Editor NEWA library to use and learn reinforcement learning algorithms
Home Page: https://learnrl.readthedocs.io/en/latest/
License: Other
A library to use and learn reinforcement learning algorithms
Home Page: https://learnrl.readthedocs.io/en/latest/
License: Other
We need that to test continuous state/action space on our agents
We need that to test adaptability between basic agents and DRL agents
We need to implement and test that properly
We need an attribute agents_order and methods to set and shuffle the order of agents
This will come handy if we want to change agents rôles in a environement during training or testing
An environement template using gym environements in a more general way to manage turns between agents.
Agents must have :
When passing a list of learnrl.Agent instances in Playground init function, the assertion "isinstance(agent, Agent))" becomes false. It is fix with deleting predefined type of input "agents".
We need to add str arguments for evaluation and control (Typicaly 'mc' for montecarlo and 'onp-onl-td' for onpolicy online td) instead of importing from evaluation and control modules
Add a get started part with tutorials and example inside the documentation.
We need tests for Playgroud
Include Gym environements composed of:
Build standard for multi-agents environements
Build "evaluation" methode to evaluate multiple agents on a number of games.
We need a test for the Basic Agent
Contributing pipeline (dev branch, feature branches, ...)
We need a greater framework for evaluations, for now we have only MonteCarlo
Basic evaluations methodes are :
We need to refactor to pytest to build markers for slow tests (Training agents on basic exemples like Nim takes ~1s with is way to slow for a test)
We need tests for dt_step and dt_episodes :
We need unit tests for core functions of BasicAgent :
We need several tests :
We need to implement the QLearningAgent directly for user-friendly purpose !
It would be nice to add ETA in the Logger.
It has to manage the different levels of verbose and use the metrics at hand to give the best an most usefull time estimate.
We need to add methods to dave and load a memory from path:
save(path)
load(path)
load should check the memory format (At least the base MEMORY_KEYS)
In need if issue #1 : Agents
It would be a good test to see if the librairie is easy to use
Codacy shows us a lot of little issues, a lot of them might be good to fix !
Issue :
I am using an agent that takes random actions. The environment is CartPole.
When I use pg.fit() with episodes >= 40, the display gives episode rewards with decimals, which should be impossible.
Code used :
import learnrl as rl
import gym
env = gym.make("CartPole-v0")
class RandomAgent(rl.Agent):
def __init__(self, env):
super().__init__()
def act(self, observation, greedy=None):
action = env.action_space.sample()
return action
def learn(self):
metrics = {}
return metrics
def remember(self,
observation,
action,
reward,
done,
next_observation=None,
info=None,
**param):
pass
agent = RandomAgent(env)
pg = rl.Playground(env, [agent])
metrics = [('reward~env-rwd', {'steps': 'sum', 'episode': 'sum'}), ('dt_step~')]
pg.fit(episodes=100, verbose=1, metrics=metrics)
What I get :
| Env-rwd | Step time |
Episode 5/100 | 22 | 26.8us/step |
Episode 10/100 | 28.6 | 23.9us/step |
Episode 15/100 | 16 | 24.0us/step |
Episode 20/100 | 19 | 25.0us/step |
Episode 25/100 | 22.8 | 23.6us/step |
Episode 30/100 | 32.8 | 24.2us/step |
Episode 35/100 | 33.2 | 23.6us/step |
Episode 40/100 | 25.2 | 25.3us/step |
Episode 45/100 | 17.4 | 23.6us/step |
Episode 50/100 | 20.8 | 27.2us/step |
Episode 55/100 | 16.8 | 25.7us/step |
Episode 60/100 | 17.8 | 23.3us/step |
Episode 65/100 | 33.8 | 28.6us/step |
Episode 70/100 | 21.4 | 25.7us/step |
Episode 75/100 | 23.8 | 24.0us/step |
Episode 80/100 | 23.8 | 24.9us/step |
Episode 85/100 | 25 | 23.3us/step |
Episode 90/100 | 13.6 | 26.1us/step |
Episode 95/100 | 23 | 22.8us/step |
Episode 100/100 | 16.4 | 25.2us/step |
This bug may depend on the device since CartPole is known to be an extremely fast environment.
Is there a way to implement that in a good and robust fashion ?
In need for issue #1 : Agents
In need of issue #1 : Agents
Need for sampling or true/learned model.
I need that for personal experience
make conda install possible
we need a TFMemory object that do the same as Memory but optimized for tensorflow
The logger might not work well for multi-agent setup.
We need a test function to ensure everything is right.
Adding intermediate verbose level between 2 and 3.
The goal is to show metrics during episodes without flooding the console.
We might need some more test functions.
Read the title.
When passing a list of learnrl.Agent instances in Playground init function, the assertion "isinstance(agent, Agent))" becomes false. It is fix with deleting predefined type of input "agents".
We could add support for elligibility traces E(lambda)
Could we really reproduce AlphaZero and MuZero's power ?
Need new tests for batch methods
Need new policies baseline (for easy adaptation)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.