From 26267fceb0ea999cb97480664c4a5de33fcdfd43 Mon Sep 17 00:00:00 2001 From: Eric Hambro <eric.hambro@gmail.com> Date: Sun, 6 Jun 2021 04:54:01 -0700 Subject: [PATCH] Remove unnecessary functions from Batched Agent. --- agents/batched_agent.py | 17 +++-------------- local_evaluation.py | 1 + 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/agents/batched_agent.py b/agents/batched_agent.py index 7108957..d5e59ce 100644 --- a/agents/batched_agent.py +++ b/agents/batched_agent.py @@ -11,20 +11,9 @@ class BatchedAgent: self.num_envs = num_envs self.num_actions = num_actions - def preprocess_observations(self, observations, rewards, dones, infos): + def batched_step(self, observations, rewards, dones, infos): """ - Add any preprocessing steps, for example rerodering/stacking for torch/tf in your model + Take list of outputs of each environments and return a list of actions """ - pass + raise NotImplementedError - def preprocess_actions(self, actions): - """ - Add any postprocessing steps, for example converting to lists - """ - pass - - def batched_step(self): - """ - Return a list of actions - """ - pass diff --git a/local_evaluation.py b/local_evaluation.py index 1ae846d..b8b625d 100644 --- a/local_evaluation.py +++ b/local_evaluation.py @@ -32,6 +32,7 @@ def evaluate(): agent = Agent(num_envs, num_actions) run_batched_rollout(batched_env, agent) + if __name__ == '__main__': evaluate() -- GitLab