import tensorflow as tf

        layer1 = tf.nn.sigmoid(layer0)
        layer2 = tf.matmul(layer1, w1) + b1
        predictions = layer2

        loss = tf.reduce_mean(tf.losses.sparse_softmax_cross_entropy(logits=predictions, labels=y))
        grads = tf.gradients(ys=loss, xs=params)
        return predictions, loss, grads

    def build_training_model(self, x, y):
        """
