Skip to content

Commit

Permalink
Rename MADDPG to NDDPG
Browse files Browse the repository at this point in the history
As the current implementation does not really follow the MADDPG
algorithm as described in the paper (link at the bottom), but rather
just trains two independent DDPG algorithms, I decided to rename it, to
avoid confusion.

https://arxiv.org/abs/1706.02275
  • Loading branch information
SwamyDev committed Mar 14, 2020
1 parent e66eab6 commit 824b0ba
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions resources/models/p3_tennis_final/type.meta
Git LFS file not shown
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from tests.auxiliary import GymSession
from udacity_rl.agents import agent_save, agent_load
from udacity_rl.agents.maddpg_agent import MADDPGAgent
from udacity_rl.agents.nddpg_agent import NDDPGAgent
from udacity_rl.epsilon import NoiseFixed


Expand Down Expand Up @@ -46,7 +46,7 @@ def n_knob():
@pytest.fixture
def make_agent(n_knob):
def factory(**kwargs):
return MADDPGAgent(n_knob.observation_space, n_knob.action_space, **kwargs)
return NDDPGAgent(n_knob.observation_space, n_knob.action_space, **kwargs)

return factory

Expand Down
4 changes: 2 additions & 2 deletions udacity_rl/agents/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

from udacity_rl.agents.dqn_agent import DQNAgent
from udacity_rl.agents.ddpg_agent import DDPGAgent
from udacity_rl.agents.maddpg_agent import MADDPGAgent
from udacity_rl.agents.nddpg_agent import NDDPGAgent

logger = logging.getLogger(__name__)

_CLASS_MAPPING = {
DQNAgent.__name__: DQNAgent,
DDPGAgent.__name__: DDPGAgent,
MADDPGAgent.__name__: MADDPGAgent,
NDDPGAgent.__name__: NDDPGAgent,
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
}


class MADDPGAgent(MemoryAgent):
class NDDPGAgent(MemoryAgent):
def __init__(self, observation_space, action_space, actor=None, critic=None, **kwargs):
super().__init__(observation_space, action_space, actor=actor, critic=critic, **kwargs)

Expand All @@ -62,7 +62,7 @@ def __init__(self, observation_space, action_space, actor=None, critic=None, **k
self._step = 0

def _print_config(self): # pragma: no cover
logger.info(f"MADDPG configuration:\n"
logger.info(f"NDDPG configuration:\n"
f"\tNumber of agents:\t{self._num_agents}\n"
f"\tObservation Size:\t{self._observation_size}\n"
f"\tAction Size:\t\t{self._action_size}\n")
Expand Down
4 changes: 2 additions & 2 deletions udacity_rl/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from udacity_rl.adapter import GymAdapter
from udacity_rl.agents import DQNAgent, agent_load, agent_save, AgentSnapshot
from udacity_rl.agents.ddpg_agent import DDPGAgent
from udacity_rl.agents.maddpg_agent import MADDPGAgent
from udacity_rl.agents.nddpg_agent import NDDPGAgent
from udacity_rl.epsilon import EpsilonExpDecay, NoiseFixed

logger = logging.getLogger(__name__)
Expand All @@ -41,7 +41,7 @@ class AgentFactory:
_AGENT_MAPPING = {
'DQN': DQNAgent,
'DDPG': DDPGAgent,
'MADDPG': MADDPGAgent,
'NDDPG': NDDPGAgent,
}

def __init__(self, algorithm_name):
Expand Down

0 comments on commit 824b0ba

Please sign in to comment.