train_space_invaders.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:ai-bs-summer17 作者: uchibe 项目源码 文件源码
def main():
    env = gym.make("SpaceInvadersNoFrameskip-v4")
    env = ScaledFloatFrame(wrap_dqn(env))
    model = deepq.models.cnn_to_mlp(
        convs=[(32, 8, 4), (64, 4, 2), (64, 3, 1)],
        hiddens=[256],
        dueling=True
    )
    act = deepq.learn(
        env,
        q_func=model,
        lr=1e-4,
        max_timesteps=2000000,
        buffer_size=10000,
        exploration_fraction=0.1,
        exploration_final_eps=0.01,
        train_freq=4,
        learning_starts=10000,
        target_network_update_freq=1000,
        gamma=0.99,
        prioritized_replay=True
    )
    act.save("space_invaders_model.pkl")
    env.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号