Method for generating the Controller

We next implement a method for generating the Controller, which we call build_controller. The first step in constructing our Controller is defining the input placeholders. We create two of these—one is for the child network DNA, which is fed as input to the RNN for generating a new child network DNA, and the second is a list for storing discounted rewards when calculating the gradients for REINFORCE:

def build_controller(self):'Building controller network')    # Build inputs and placeholders    with tf.name_scope('controller_inputs'):        # Input to the NASCell        self.child_network_architectures = tf.placeholder(tf.float32, [None, self.num_cell_outputs],                                                           name='controller_input')        # Discounted rewards ...

Get Python Reinforcement Learning Projects now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.