def forward_final(self, x, batch_size=None):
        """
        Forward propagation through the whole network; returns only output of final layer.

        Parameters
        ----------
        x : numpy array, training examples; shape should be (NUMBER_OF_EXAMPLES,) + self.input_shape
        batch_size : number of samples to process at a time (conserves memory)
        
        Returns
        -------
        acts : activations of the final layer

        """
        if batch_size is None or batch_size > x.shape[0]:
            batch_size = x.shape[0]

        ind = 0
        res = []
        while ind < x.shape[0]:
            acts = x[ind:ind+batch_size,...]
            for layer in self.layers_:
                acts = layer.forward(acts)
            res.append(acts)
            ind += batch_size
        return np.concatenate(res) if len(res)>1 else res[0]
dataset/ETHPy150Open bbabenko/simple_convnet/simple_convnet/convnet.py/NNet.forward_final/original