'Build the core model within the graph.'

def forward_pass(self, x, input_data_format='channels_last'):

    if (self._data_format != input_data_format):
        if (input_data_format == 'channels_last'):
            x = tf.transpose(x, [0, 3, 1, 2])
        else:
            x = tf.transpose(x, [0, 2, 3, 1])
    x = ((x / 128) - 1)
    x = self._conv(x, 3, 16, 1)
    x = self._batch_norm(x)
    x = self._relu(x)
    res_func = self._residual_v1
    for i in range(3):
        with tf.name_scope('stage'):
            for j in range(self.n):
                if (j == 0):
                    x = res_func(x, 3, self.filters[i], self.filters[(i + 1)], self.strides[i])
                else:
                    x = res_func(x, 3, self.filters[(i + 1)], self.filters[(i + 1)], 1)
    x = self._global_avg_pool(x)
    x = self._fully_connected(x, self.num_classes)
    return x
