nas-search/singlepath_supernet.py
def call(self, inputs, training=True):
    """Implementation of SuperNet call().

    Args:
      inputs: input tensors.
      training: boolean, whether the model is constructed for training.

    Returns:
      output tensors.
    """
    outputs = None
    self.endpoints = {}
    self.indicators = {}

    # rest of runtime (i.e., stem, head, logits, block0, block21)
    total_runtime = 19.5999

    # Calls Stem layers
    with tf.variable_scope('mnas_stem'):
      outputs = tf.nn.relu(
          self._bn0(self._conv_stem(inputs), training=training))
    tf.logging.info('Built stem layers with output shape: %s' % outputs.shape)
    self.endpoints['stem'] = outputs
    # Calls blocks.
    for idx, block in enumerate(self._blocks):
      with tf.variable_scope('mnas_blocks_%s' % idx):
        outputs, total_runtime = block.call(outputs, total_runtime, training=training)
        self.endpoints['block_%s' % idx] = outputs
        # the indicator decisions 
        if block._depthwise_conv.custom:
          self.indicators['block_%s' % idx] = {
                  'd5x5': block._depthwise_conv.d5x5,
                  'd50c': block._depthwise_conv.d50c,
                  'd100c': block._depthwise_conv.d100c}

        if block.endpoints:
          for k, v in six.iteritems(block.endpoints):
            self.endpoints['block_%s/%s' % (idx, k)] = v
    # Calls final layers and returns logits.
    with tf.variable_scope('mnas_head'):
      outputs = tf.nn.relu(
          self._bn1(self._conv_head(outputs), training=training))
      outputs = self._avg_pooling(outputs)
      if self._dropout:
        outputs = self._dropout(outputs, training=training)
      outputs = self._fc(outputs)
      self.endpoints['head'] = outputs

    return outputs, total_runtime
Implementation of SuperNet call().

    Args:
      inputs: input tensors.
      training: boolean, whether the model is constructed for training.

    Returns:
      output tensors.
    
Implementation of SuperNet call().
Implementation of SuperNet call () .
def call(self, inputs, training=True):
    outputs = None
    self.endpoints = {}
    self.indicators = {}
    total_runtime = 19.5999
    with tf.variable_scope('mnas_stem'):
      outputs = tf.nn.relu(
          self._bn0(self._conv_stem(inputs), training=training))
    tf.logging.info('Built stem layers with output shape: %s' % outputs.shape)
    self.endpoints['stem'] = outputs
    for idx, block in enumerate(self._blocks):
      with tf.variable_scope('mnas_blocks_%s' % idx):
        outputs, total_runtime = block.call(outputs, total_runtime, training=training)
        self.endpoints['block_%s' % idx] = outputs
        if block._depthwise_conv.custom:
          self.indicators['block_%s' % idx] = {
                  'd5x5': block._depthwise_conv.d5x5,
                  'd50c': block._depthwise_conv.d50c,
                  'd100c': block._depthwise_conv.d100c}
        if block.endpoints:
          for k, v in six.iteritems(block.endpoints):
            self.endpoints['block_%s/%s' % (idx, k)] = v
    with tf.variable_scope('mnas_head'):
      outputs = tf.nn.relu(
          self._bn1(self._conv_head(outputs), training=training))
      outputs = self._avg_pooling(outputs)
      if self._dropout:
        outputs = self._dropout(outputs, training=training)
      outputs = self._fc(outputs)
      self.endpoints['head'] = outputs
    return outputs, total_runtime
def call ( self , inputs , training = True ) : outputs = None self . endpoints = { } self . indicators = { } total_runtime = 19.5999 with tf . variable_scope ( 'mnas_stem' ) : outputs = tf . nn . relu ( self . _bn0 ( self . _conv_stem ( inputs ) , training = training ) ) tf . logging . info ( 'Built stem layers with output shape: %s' % outputs . shape ) self . endpoints [ 'stem' ] = outputs for idx , block in enumerate ( self . _blocks ) : with tf . variable_scope ( 'mnas_blocks_%s' % idx ) : outputs , total_runtime = block . call ( outputs , total_runtime , training = training ) self . endpoints [ 'block_%s' % idx ] = outputs if block . _depthwise_conv . custom : self . indicators [ 'block_%s' % idx ] = { 'd5x5' : block . _depthwise_conv . d5x5 , 'd50c' : block . _depthwise_conv . d50c , 'd100c' : block . _depthwise_conv . d100c } if block . endpoints : for k , v in six . iteritems ( block . endpoints ) : self . endpoints [ 'block_%s/%s' % ( idx , k ) ] = v with tf . variable_scope ( 'mnas_head' ) : outputs = tf . nn . relu ( self . _bn1 ( self . _conv_head ( outputs ) , training = training ) ) outputs = self . _avg_pooling ( outputs ) if self . _dropout : outputs = self . _dropout ( outputs , training = training ) outputs = self . _fc ( outputs ) self . endpoints [ 'head' ] = outputs return outputs , total_runtime
Implementation of SuperNet call().
Implementation of SuperNet call () .
"""Implementation of SuperNet call().

    Args:
      inputs: input tensors.
      training: boolean, whether the model is constructed for training.

    Returns:
      output tensors.
    """ # rest of runtime (i.e., stem, head, logits, block0, block21) # Calls Stem layers # Calls blocks. # the indicator decisions  # Calls final layers and returns logits.
None
self
inputs
None
training
boolean, whether the model is constructed for training.
boolean whether the model is constructed for training .