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):    logger.info('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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.