'Calculate the output for the given input x.'

def predict(self, feed):

    feed = Feed.from_any(feed)
    self.phase = 'test'
    if isinstance(self.loss, SoftmaxCrossEntropy):
        self.layers += [self.loss]
    y = []
    for (x_batch,) in feed.batches():
        y.append(np.array(self.fprop(x_batch)))
    y = np.concatenate(y)[:feed.n_samples]
    if isinstance(self.loss, SoftmaxCrossEntropy):
        self.layers = self.layers[:(-1)]
    return y
