(self)
Builds the graph.
Builds the graph.
Builds the graph .
def build(self):
    """Builds the graph."""
    featuremaps = self.get_convnet_input()
    self.residual_init()

    layers = self.hparams.get_conv_arch().layers
    n = len(layers)
    for i, layer in enumerate(layers):
      with tf.variable_scope('conv%d' % i):
        self.residual_counter += 1
        self.residual_save(featuremaps)

        featuremaps = self.apply_convolution(featuremaps, layer, i)
        featuremaps = self.apply_residual(
            featuremaps, is_first=i == 0, is_last=i == n - 1)
        featuremaps = self.apply_activation(featuremaps, layer)
        featuremaps = self.apply_pooling(featuremaps, layer)

        self.hiddens.append(featuremaps)

    self.logits = featuremaps
    self.predictions = self.compute_predictions(logits=self.logits)
    self.cross_entropy = self.compute_cross_entropy(
        logits=self.logits, labels=self.pianorolls)

    self.compute_loss(self.cross_entropy)
    self.setup_optimizer()

    for var in tf.trainable_variables():
      tf.logging.info('%s_%r', var.name, var.get_shape().as_list())
def build ( self ) : featuremaps = self . get_convnet_input ( ) self . residual_init ( ) layers = self . hparams . get_conv_arch ( ) . layers n = len ( layers ) for i , layer in enumerate ( layers ) : with tf . variable_scope ( 'conv%d' % i ) : self . residual_counter += 1 self . residual_save ( featuremaps ) featuremaps = self . apply_convolution ( featuremaps , layer , i ) featuremaps = self . apply_residual ( featuremaps , is_first = i == 0 , is_last = i == n - 1 ) featuremaps = self . apply_activation ( featuremaps , layer ) featuremaps = self . apply_pooling ( featuremaps , layer ) self . hiddens . append ( featuremaps ) self . logits = featuremaps self . predictions = self . compute_predictions ( logits = self . logits ) self . cross_entropy = self . compute_cross_entropy ( logits = self . logits , labels = self . pianorolls ) self . compute_loss ( self . cross_entropy ) self . setup_optimizer ( ) for var in tf . trainable_variables ( ) : tf . logging . info ( '%s_%r' , var . name , var . get_shape ( ) . as_list ( ) )