import tensorflow as tf

        b1 = self.b1.read_value()
        params = (w0, b0, w1, b1)

        layer0 = tf.matmul(x, w0) + b0
        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)
