update PolicyGradient

This commit is contained in:
JohnJim0816
2020-11-23 12:13:34 +08:00
parent 4f192c7aac
commit 4cc12bf97f
5 changed files with 185 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env python
# coding=utf-8
'''
Author: John
Email: johnjim0816@gmail.com
Date: 2020-11-22 23:23:10
LastEditor: John
LastEditTime: 2020-11-23 11:55:24
Discription:
Environment:
'''
import gym
def env_init():
env = gym.make('CartPole-v0') # 可google为什么unwrapped gym此处一般不需要
env.seed(1) # 设置env随机种子
n_states = env.observation_space.shape[0]
n_actions = env.action_space.n
return env,n_states,n_actions