import tensorflow as tf

        w0 = self.w0.read_value()
        b0 = self.b0.read_value()
        w1 = self.w1.read_value()
        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)
        return predictions, loss, grads

    def build_training_model(self, x, y):
        """
        This method will be called once by all data owners
        to create a local gradient computation on their machine.
        """
        _, _, grads = self._build_model(x, y)
        return grads
