

def predict(self, feed):
    ' Calculate the output for the given input x. '
    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

dataset/ETHPy150Open andersbll/deeppy/deeppy/feedforward/neural_network.py NeuralNetwork.predict/original