コード例 #1
0
ファイル: run_baseline.py プロジェクト: ioanachelu/turi
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()
コード例 #2
0
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()
コード例 #3
0
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}')
コード例 #4
0
ファイル: controller.py プロジェクト: owensilj/2048-AI
 def run_random_agent(self):
     # Runs the random agent
     agent = RandomAgent(self._board)
     agent.play()