diff --git a/genrl/trainers/classical.py b/genrl/trainers/classical.py index 2e75aeb2..b773b6e7 100644 --- a/genrl/trainers/classical.py +++ b/genrl/trainers/classical.py @@ -161,9 +161,11 @@ def evaluate(self, eval_ep: int = 100) -> float: ep_rew += reward if done: ep_rews.append(ep_rew) - ep += 1 mean_ep_rew = np.mean(ep_rews) - if ep == 100: + ep += 1 + state = self.env.reset() + ep_rew = 0 + if ep == eval_ep: print( "Evaluated for {} episodes, Mean Reward: {:.2f}, Std Deviation for the Reward: {:.2f}".format( eval_ep, mean_ep_rew, np.std(ep_rews)