def run(): tf.reset_default_graph() sess = tf.Session() with sess: with tf.device("/cpu:0"): gym_env = gym.make(FLAGS.game) if FLAGS.monitor: gym_env = gym.wrappers.Monitor(gym_env, FLAGS.experiments_dir + '/baseline', force=True) agent = RandomAgent(gym_env) agent.play()
def main(): script_args = parse_args() if script_args.use_retro: env = retro.make(script_args.env_name) else: env = gym.make(script_args.env_name) random_agent = RandomAgent(env) random_agent.train(script_args.num_episodes, script_args.render_train) play_reward = random_agent.play() print(f'Reward after playing: {play_reward}')
def run_random_agent(self): # Runs the random agent agent = RandomAgent(self._board) agent.play()