def _learn(self, batch, activations):
    """
    Learns a single iteration on the provided batch and activations.
    :param batch:      (array)  Training batch, of dimension (filterDim,
                                batchSize)
    :param activations:(array)  Computed activations, of dimension (outputDim,
                                batchSize)
    """
    batchResiduals = batch - self.basis.dot(activations)
    loss = np.mean(np.sqrt(np.sum(batchResiduals ** 2, axis=0)))
    self.losses[self._iteration] = loss

    if self.verbosity >= 2:
      if self._iteration % self.showEvery == 0:
        print "At iteration {0}, loss is {1:.3f}".format(self._iteration, loss)

    # update basis
    gradBasis = batchResiduals.dot(activations.T) / self.batchSize
    self.basis += self.learningRate * gradBasis

    # normalize basis
    self.basis /= np.sqrt(np.sum(self.basis ** 2, axis=0))
Learns a single iteration on the provided batch and activations.
    :param batch:      (array)  Training batch, of dimension (filterDim,
                                batchSize)
    :param activations:(array)  Computed activations, of dimension (outputDim,
                                batchSize)