Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

7 changes: 0 additions & 7 deletions mighty/configs/environment/pufferlib_ocean/memory.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion mighty/configs/environment/pufferlib_ocean/password.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ num_steps: 50_000
env: pufferlib.ocean.password
env_kwargs: {}
env_wrappers: []
num_envs: 1
num_envs: 64
4 changes: 2 additions & 2 deletions mighty/configs/environment/pufferlib_ocean/squared.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
num_steps: 50_000
env: pufferlib.ocean.squared
env_kwargs: {}
env_wrappers: [mighty.utils.wrappers.FlattenVecObs]
num_envs: 1
env_wrappers: [mighty.mighty_utils.wrappers.FlattenVecObs]
num_envs: 64
2 changes: 1 addition & 1 deletion mighty/configs/environment/pufferlib_ocean/stochastic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ num_steps: 50_000
env: pufferlib.ocean.stochastic
env_kwargs: {}
env_wrappers: []
num_envs: 1
num_envs: 64
3 changes: 2 additions & 1 deletion mighty/configs/exploration/ez_greedy.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# @package _global_
algorithm_kwargs:
policy_class: mighty.mighty_exploration.EZGreedy
policy_class: mighty.mighty_exploration.EZGreedy
policy_kwargs: null
51 changes: 0 additions & 51 deletions mighty/configs/ppo_smac.yaml

This file was deleted.

51 changes: 0 additions & 51 deletions mighty/configs/sac_smac.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions mighty/configs/search_space/dqn_rs.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions mighty/configs/search_space/dqn_template.yaml

This file was deleted.

41 changes: 0 additions & 41 deletions mighty/configs/search_space/ppo_rs.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions mighty/configs/search_space/sac_rs.yaml

This file was deleted.

44 changes: 0 additions & 44 deletions mighty/configs/sweep_ppo_pbt.yaml

This file was deleted.

38 changes: 0 additions & 38 deletions mighty/configs/sweep_rs.yaml

This file was deleted.

6 changes: 5 additions & 1 deletion mighty/mighty_agents/base_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import pandas as pd
import torch
import wandb
from omegaconf import DictConfig
from omegaconf import DictConfig, OmegaConf
from rich import print
from rich.layout import Layout
from rich.live import Live
Expand Down Expand Up @@ -323,6 +323,10 @@ def initialize_agent(self) -> None:
if isinstance(self.buffer_class, type) and issubclass(
self.buffer_class, PrioritizedReplay
):
if isinstance(self.buffer_kwargs, DictConfig):
self.buffer_kwargs = OmegaConf.to_container(
self.buffer_kwargs, resolve=True
)
# 1) Get observation-space shape
try:
obs_space = self.env.single_observation_space
Expand Down
14 changes: 8 additions & 6 deletions mighty/mighty_utils/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,21 @@ def __init__(self, env):

"""
super().__init__(env)
self.n_actions = len(self.env.single_action_space.nvec)
self.single_action_space = gym.spaces.Discrete(
np.prod(self.env.single_action_space.nvec)
)
self.n_actions = len(self.env.action_space.nvec)

self.action_mapper = {}
for idx, prod_idx in zip(
range(np.prod(self.env.single_action_space.nvec)),
range(np.prod(self.env.action_space.nvec)),
itertools.product(
*[np.arange(val) for val in self.env.single_action_space.nvec]
*[np.arange(val) for val in self.env.action_space.nvec]
),
):
self.action_mapper[idx] = prod_idx

self.action_space = gym.spaces.Discrete(
int(np.prod(self.env.action_space.nvec))
)

def step(self, action):
"""Maps discrete action value to array."""
action = [self.action_mapper[a] for a in action]
Expand Down