actor_network.py 文件源码

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

项目:-NIPS-2017-Learning-to-Run 作者: kyleliang919 项目源码 文件源码
def create_network(self,state_dim,action_dim,scope):
    with tf.variable_scope(scope):
           layer1_size = LAYER1_SIZE
           layer2_size = LAYER2_SIZE

           state_input = tf.placeholder("float",[None,state_dim])

           W1 = self.variable([state_dim,layer1_size],state_dim)
           b1 = self.variable([layer1_size],state_dim)
           W2 = self.variable([layer1_size,layer2_size],layer1_size)
           b2 = self.variable([layer2_size],layer1_size)
           W3 = tf.Variable(tf.random_uniform([layer2_size,action_dim],-3e-3,3e-3))
           b3 = tf.Variable(tf.random_uniform([action_dim],-3e-3,3e-3))

           layer1 = tf.nn.relu(tf.matmul(state_input,W1) + b1)
           layer2 = tf.nn.relu(tf.matmul(layer1,W2) + b2)
           action_output = tf.clip_by_value(tf.nn.relu(tf.matmul(layer2,W3) + b3),0.0,1.0)

           return state_input,action_output,[W1,b1,W2,b2,W3,b3]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号