March 2019
Intermediate to advanced
184 pages
4h 57m
English
The actor and critic file, AandC.py, also needs to be modified. In particular, the create_actor_network in the ActorNetwork class is edited to have two hidden layers with 400 and 300 neurons, respectively. Also, the output consists of three actions: steering, acceleration, and brake. Since steering is in the [-1,1] range, the tanh activation function is used; acceleration and brake are in the [0,1] range, and so the sigmoid activation function is used. We then concat them along axis dimension 1, and this is the output of our actor's policy:
def create_actor_network(self, scope): with tf.variable_scope(scope, reuse=tf.AUTO_REUSE): state = tf.placeholder(name='a_states', dtype=tf.float32, shape=[None, self.s_dim]) net = tf.layers.dense(inputs=state, ...
Read now
Unlock full access