mirror of
https://github.com/gryf/coach.git
synced 2025-12-17 19:20:19 +01:00
Create a dataset using an agent (#306)
Generate a dataset using an agent (allowing to select between this and a random dataset)
This commit is contained in:
@@ -59,9 +59,13 @@ class ParameterNoise(ExplorationPolicy):
|
||||
self.network_params = network_params
|
||||
self._replace_network_dense_layers()
|
||||
|
||||
def get_action(self, action_values: List[ActionType]) -> ActionType:
|
||||
def get_action(self, action_values: List[ActionType]):
|
||||
if type(self.action_space) == DiscreteActionSpace:
|
||||
return np.argmax(action_values)
|
||||
action = np.argmax(action_values)
|
||||
one_hot_action_probabilities = np.zeros(len(self.action_space.actions))
|
||||
one_hot_action_probabilities[action] = 1
|
||||
|
||||
return action, one_hot_action_probabilities
|
||||
elif type(self.action_space) == BoxActionSpace:
|
||||
action_values_mean = action_values[0].squeeze()
|
||||
action_values_std = action_values[1].squeeze()
|
||||
|
||||
Reference in New Issue
Block a user