'This function should build the model which takes the input variables
and define self.cost at the end'

def _build_graph(self, inputs):

    (image, label) = inputs
    image = tf.expand_dims(image, 3)
    image = ((image * 2) - 1)
    with argscope(Conv2D, kernel_shape=3, nl=tf.nn.relu, out_channel=32):
        logits = LinearWrap(image).Conv2D('conv0').MaxPooling('pool0', 2).Conv2D('conv1').Conv2D('conv2').MaxPooling('pool1', 2).Conv2D('conv3').FullyConnected('fc0', 512, nl=tf.nn.relu).Dropout('dropout', 0.5).FullyConnected('fc1', out_dim=10, nl=tf.identity)()
    prob = tf.nn.softmax(logits, name='prob')
    cost = tf.nn.sparse_softmax_cross_entropy_with_logits(logits=logits, labels=label)
    cost = tf.reduce_mean(cost, name='cross_entropy_loss')
    wrong = symbf.prediction_incorrect(logits, label, name='incorrect')
    accuracy = symbf.accuracy(logits, label, name='accuracy')
    train_error = tf.reduce_mean(wrong, name='train_error')
    summary.add_moving_summary(train_error, accuracy)
    wd_cost = tf.multiply(1e-05, regularize_cost('fc.*/W', tf.nn.l2_loss), name='regularize_loss')
    self.cost = tf.add_n([wd_cost, cost], name='total_cost')
    summary.add_moving_summary(cost, wd_cost, self.cost)
    summary.add_param_summary(('.*/W', ['histogram', 'rms']))
