From 84abf760a6ecd1afb8cba9d453b453faa3737780 Mon Sep 17 00:00:00 2001 From: Gaurav Pathak Date: Tue, 25 Sep 2018 23:52:14 -0400 Subject: [PATCH] t was not defined, I assumed to be equal to batch size and computing the adaptive parameter from there --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index e4c1d91..8c58143 100644 --- a/main.py +++ b/main.py @@ -118,8 +118,8 @@ writer.add_scalar('reward/train', episode_reward, i_episode) # Update param_noise based on distance metric - if args.param_noise: - episode_transitions = memory.memory[memory.position-t:memory.position] + if args.param_noise and len(memory) >= args.batch_size: + episode_transitions = memory.memory[memory.position-args.batch_size:memory.position] states = torch.cat([transition[0] for transition in episode_transitions], 0) unperturbed_actions = agent.select_action(states, None, None) perturbed_actions = torch.cat([transition[1] for transition in episode_transitions], 0)