mirror of
https://github.com/gryf/coach.git
synced 2025-12-17 11:10:20 +01:00
Bug fix: when enabling 'heatup_using_network_decisions', we should add the configured noise (#162)
During heatup we may want to add agent-generated-noise (i.e. not "simple" random noise). This is enabled by setting 'heatup_using_network_decisions' to True. For example: agent_params = DDPGAgentParameters() agent_params.algorithm.heatup_using_network_decisions = True The fix ensures that the correct noise is added not just while in the TRAINING phase, but also during the HEATUP phase. No one has enabled 'heatup_using_network_decisions' yet, which explains why this problem arose only now (in my configuration I do enable 'heatup_using_network_decisions').
This commit is contained in:
committed by
Gal Leibovich
parent
f9ee526536
commit
b4bc8a476c
@@ -88,7 +88,7 @@ class AdditiveNoise(ExplorationPolicy):
|
||||
action_values_mean = action_values.squeeze()
|
||||
|
||||
# step the noise schedule
|
||||
if self.phase == RunPhase.TRAIN:
|
||||
if self.phase is not RunPhase.TEST:
|
||||
self.noise_percentage_schedule.step()
|
||||
# the second element of the list is assumed to be the standard deviation
|
||||
if isinstance(action_values, list) and len(action_values) > 1:
|
||||
|
||||
@@ -92,7 +92,7 @@ class TruncatedNormal(ExplorationPolicy):
|
||||
action_values_mean = action_values.squeeze()
|
||||
|
||||
# step the noise schedule
|
||||
if self.phase == RunPhase.TRAIN:
|
||||
if self.phase is not RunPhase.TEST:
|
||||
self.noise_percentage_schedule.step()
|
||||
# the second element of the list is assumed to be the standard deviation
|
||||
if isinstance(action_values, list) and len(action_values) > 1:
|
||||
|
||||
Reference in New Issue
Block a user