March 2019
Intermediate to advanced
184 pages
4h 57m
English
We will now describe the AC class, which is also part of a3c.py. We define the constructor of the AC class with an input placeholder, two fully connected hidden layers with 256 and 128 neurons, respectively, and the elu activation function. This is followed by the policy network with the softmax activation, since our actions our discrete for CartPole. In addition, we also have a value network with no activation function. Note that we share the same hidden layers for both the policy and value, unlike in past examples:
class AC(): def __init__(self,s_size,a_size,scope,trainer): with tf.variable_scope(scope): self.inputs = tf.placeholder(shape=[None,s_size],dtype=tf.float32) # 2 FC layers net = tf.layers.dense(self.inputs, 256, ...
Read now
Unlock full access