Coach version : 1.0.1
Ubuntu version : 19.10
Environment : Discrete Custom Gym-Environment
Algorithm : DQN with Boltzmann Exploration
Hi, I created a custom gym environment which uses a discrete action space with 5 actions. It works with E-Greedy Exploration, but with Boltzmann Exploration it yields this error:
rl_coach/exploration_policies/boltzmann.py", line 61, in get_action
action = np.random.choice(range(self.action_space.shape), p=probabilities)
TypeError: only integer scalar arrays can be converted to a scalar index
It seems to me that discrete action spaces, which are converted from gym environments always have shape 1 (rl_coach/spaces.py):
class DiscreteActionSpace(ActionSpace):
"""
A discrete action space with action indices as actions
"""
def __init__(self, num_actions: int, descriptions: Union[None, List, Dict]=None, default_action: np.ndarray=None,
filtered_action_space=None):
super().__init__(1, low=0, high=num_actions-1, descriptions=descriptions)
# the number of actions is mapped to high
# default action
if default_action is None:
self.default_action = 0
else:
self.default_action = default_action
if filtered_action_space is not None:
self.filtered_action_space = filtered_action_space
I don't know the reason, but it seems weird to me.
Coach version : 1.0.1 Ubuntu version : 19.10 Environment : Discrete Custom Gym-Environment Algorithm : DQN with Boltzmann Exploration
Hi, I created a custom gym environment which uses a discrete action space with 5 actions. It works with E-Greedy Exploration, but with Boltzmann Exploration it yields this error:
It seems to me that discrete action spaces, which are converted from gym environments always have shape 1 (rl_coach/spaces.py):
I don't know the reason, but it seems weird to me.
I use this Preset: