From 2dca10404443ce3178343c07ba6e22af13efb006 Mon Sep 17 00:00:00 2001 From: pbartet Date: Mon, 14 Aug 2017 11:47:51 +0200 Subject: [PATCH] reinforcement_learning fix reward threshold --- reinforcement_learning/actor_critic.py | 2 +- reinforcement_learning/reinforce.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reinforcement_learning/actor_critic.py b/reinforcement_learning/actor_critic.py index 87180ab412..ccaebd52ef 100644 --- a/reinforcement_learning/actor_critic.py +++ b/reinforcement_learning/actor_critic.py @@ -99,7 +99,7 @@ def finish_episode(): if i_episode % args.log_interval == 0: print('Episode {}\tLast length: {:5d}\tAverage length: {:.2f}'.format( i_episode, t, running_reward)) - if running_reward > 200: + if running_reward > env.spec.reward_threshold: print("Solved! Running reward is now {} and " "the last episode runs to {} time steps!".format(running_reward, t)) break diff --git a/reinforcement_learning/reinforce.py b/reinforcement_learning/reinforce.py index cf356399aa..2506b54d55 100644 --- a/reinforcement_learning/reinforce.py +++ b/reinforcement_learning/reinforce.py @@ -89,7 +89,7 @@ def finish_episode(): if i_episode % args.log_interval == 0: print('Episode {}\tLast length: {:5d}\tAverage length: {:.2f}'.format( i_episode, t, running_reward)) - if running_reward > 200: + if running_reward > env.spec.reward_threshold: print("Solved! Running reward is now {} and " "the last episode runs to {} time steps!".format(running_reward, t)) break