Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

An implementation of MADDPG multi-agent to solve a Unity environment like Tennis and Soccer.

NotificationsYou must be signed in to change notification settings

eljandoubi/MADDPG-for-Collaboration-and-Competition

Repository files navigation

This repository contains material from thethird Udacity DRL procjet and the coding exerciceDDPG-pendulum.

Introduction

In this project, we train a MADDPG multi-agent to solve two types of environment.

FirstTennis :

Trained Agent

In this environment, two agents control rackets to bounce a ball over a net. If an agent hits the ball over the net, it receives a reward of$+0.1$. If an agent lets a ball hit the ground or hits the ball out of bounds, it receives a reward of$-0.01$. Thus, the goal of each agent is to keep the ball in play.

The observation space consists of$24$ variables corresponding to the position and velocity of the ball and racket. Each agent receives its own, local observation. Two continuous actions are available, corresponding to movement toward (or away from) the net, and jumping.


Second,Soccer :

Crawler

In this discrete control environment, four agents compete in a$2$ strikers vs$2$ goalies in soccer game. The goal for a Striker is to get the ball into the opponent's goal and for Goalie is to keep the ball out of the goal.A striker/goalie receive a reward of$\pm 1$ when ball enters goal and$\mp 10^{-3}$ for existential.


An environment is considered solved, when an average score of +0.5 over 100 consecutive episodes, and for each agent is obtained.

Dependencies

To set up your python environment to run the code in this repository, follow the instructions below.

  1. Create (and activate) a new environment with Python 3.9.

    • Linux orMac:
    conda create --name drlndsource activate drlnd
    • Windows:
    conda create --name drlnd activate drlnd
  2. Follow the instructions inPytorch web page to install pytorch and its dependencies (PIL, numpy,...). For Windows and cuda 11.6

    conda install pytorch torchvision torchaudio cudatoolkit=11.6 -c pytorch -c conda-forge
  3. Follow the instructions inthis repository to perform a minimal install of OpenAI gym.

    • Install thebox2d environment group by following the instructionshere.
    pip install gym[box2d]
  4. Follow the instructions inthird Udacity DRL procjet to get the environment.

  5. Clone the repository, and navigate to thepython/ folder. Then, install several dependencies.

git clone https://github.com/eljandoubi/MADDPG-for-Collaboration-and-Competition.gitcd MADDPG-for-Collaboration-and-Competition/pythonpip install.
  1. Create anIPython kernel for thedrlnd environment.
python -m ipykernel install --user --name drlnd --display-name"drlnd"
  1. Before running code in a notebook, change the kernel to match thedrlnd environment by using the drop-downKernel menu.

Kernel

Training and inference

You can train and/or inference Tennis environment:

Run the training and/or inference cell ofTennis.ipynb.

The pre-trained models with the highest score are stored inTennis_checkpoint.

Same for Soccer but the current checkpoint isn't the best.

Implementation and Resultats

The implementation and resultats are discussed in the report.

About

An implementation of MADDPG multi-agent to solve a Unity environment like Tennis and Soccer.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp