def qfunction(obs, act, theta, name="qfunction"):
with tf.variable_op_scope([obs, act], name, name):
h0 = tf.identity(obs, name='h0-obs')
h0a = tf.identity(act, name='h0-act')
h1 = tf.nn.relu(tf.matmul(h0, theta[0]) + theta[1], name='h1')
h1a = tf.concat(1, [h1, act])
h2 = tf.nn.relu(tf.matmul(h1a, theta[2]) + theta[3], name='h2')
qs = tf.matmul(h2, theta[4]) + theta[5]
q = tf.squeeze(qs, [1], name='h3-q')
return q
评论列表
文章目录