Skip to content

Commit

Permalink
Fix in IDDPG online gymnasium mamujoco.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcformanek committed Dec 6, 2023
1 parent b250201 commit cc24c4d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/tf2/online/iddpg_mamujoco.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from og_marl.environments.wrappers import PadObsandActs, Dtype
from og_marl.loggers import WandbLogger
from og_marl.tf2.systems.iddpg import IDDPGSystem
from og_marl.environments.old_mamujoco import MAMuJoCo
from og_marl.environments.gymnasium_mamujoco import MAMuJoCo
from og_marl.replay_buffers import SequenceCPPRB

env = MAMuJoCo("4ant")
Expand All @@ -24,7 +24,7 @@

env = Dtype(env, "float32")

logger = WandbLogger(entity="claude_formanek")
logger = WandbLogger()

system = IDDPGSystem(env, logger)

Expand Down
1 change: 1 addition & 0 deletions install_environments/gymnasium_robotics.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pip install -r install_environments/requirements/gymnasium_mamujoco.txt
2 changes: 2 additions & 0 deletions install_environments/requirements/gymnasium_mamujoco.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mujoco
gymnasium_robotics
6 changes: 3 additions & 3 deletions og_marl/environments/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ def __init__(self, environment):
self._environment = environment

self._obs_dim = 0
self._act_dim = 0
self._num_actions = 0

for agent in self._environment.possible_agents:
act_dim = self._environment.action_spaces[agent].shape[0]
obs_dim = self._environment.observation_spaces[agent].shape[0]

if act_dim > self._act_dim:
self._act_dim = act_dim
if act_dim > self._num_actions:
self._num_actions = act_dim

if obs_dim > self._obs_dim:
self._obs_dim = obs_dim
Expand Down
2 changes: 1 addition & 1 deletion og_marl/tf2/systems/iddpg.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def __init__(
critic_learning_rate=3e-4,
policy_learning_rate=1e-3,
add_agent_id_to_obs=True,
random_exploration_timesteps=50_000
random_exploration_timesteps=50_000
):

super().__init__(
Expand Down

0 comments on commit cc24c4d

Please sign in to comment.