I'm an entrepreneur, innovator and technology hobbyist driven by creativity and knowledge.
blavad / marl Goto Github PK
View Code? Open in Web Editor NEWMulti-agent reinforcement learning framework
Home Page: https://www.david-albert.fr/marl
Multi-agent reinforcement learning framework
Home Page: https://www.david-albert.fr/marl
@blavad
thanks for the huge repo
hi i have a query
i would like to train two agents with DQN of same environment, but independent of them (agents)
is it possible, if so help me out
thanks for the huge repo
@blavad
seems this should be added tow multi agent system
from marl.marl import MARL
After the installation of both Soccer and marl i tried to run the second example with the MinMaxQAgent but I got the error:
AttributeError: 'MARL' object has no attribute 'experience'
Following the Traceback:
#> Start learning process.
| Date : 16/06/2021 12:28:09
Traceback (most recent call last):
File "prova.py", line 30, in
mas.learn(env, nb_timesteps=100000)
File "/home/tiago/Scrivania/Libri magistrale/Tesi/Cidici Git/marl/marl/agent/agent.py", line 265, in learn
self.update_model(timestep)
File "/home/tiago/Scrivania/Libri magistrale/Tesi/Cidici Git/marl/marl/marl.py", line 85, in update_model
ag.update_model(t)
File "/home/tiago/Scrivania/Libri magistrale/Tesi/Cidici Git/marl/marl/agent/q_agent.py", line 53, in update_model
batch = self.mas.experience.get_transition(len(self.mas.experience) - np.array(ind)-1)
AttributeError: 'MARL' object has no attribute 'experience'
prova.py contains the code of the second example that is the following (the same of the README):
import marl
from marl import MARL
from marl.agent import MinimaxQAgent
from marl.exploration import EpsGreedyfrom soccer import DiscreteSoccerEnv
# Environment available here "https://github.com/blavad/soccer"
env = DiscreteSoccerEnv(nb_pl_team1=1, nb_pl_team2=1)obs_s = env.observation_space
act_s = env.action_space
# Custom exploration process
expl1 = EpsGreedy(eps_deb=1.,eps_fin=.3)
expl2 = EpsGreedy(eps_deb=1.,eps_fin=.3)
# Create two minimax-Q agents
q_agent1 = MinimaxQAgent(obs_s, act_s, act_s, exploration=expl1, gamma=0.9, lr=0.001, name="SoccerJ1")
q_agent2 = MinimaxQAgent(obs_s, act_s, act_s, exploration=expl2, gamma=0.9, lr=0.001, name="SoccerJ2")
# Create the trainable multi-agent system
mas = MARL(agents_list=[q_agent1, q_agent2])
# Assign MAS to each agent
q_agent1.set_mas(mas)
q_agent2.set_mas(mas)
# Train the agent for 100 000 timesteps
mas.learn(env, nb_timesteps=100000)
# Test the agents for 10 episodes
mas.test(env, nb_episodes=10, time_laps=0.5)
Thank you in advance
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.