def observe(self, x):
        assert(numpy.size(x) == self.n_dim)

        self.n_observations += 1

        # Add the *non-centered* observation to Xt.
        row = self.n_eigen + self.minibatch_index
        self.Xt[row] = x

        # Update the discounted sum of the observations.
        self.x_sum *= self.gamma
        self.x_sum += x

        # To get the mean, we must normalize the sum by:
        # \gamma^(n_observations-1) + /gamma^(n_observations-2) + ... + 1
        normalizer = (1.0 - pow(self.gamma, self.n_observations)) / \
                     (1.0 - self.gamma)

        # Now center the observation.
        # We will lose the first observation as it is the only one in the mean.
        if self.centering:
            self.Xt[row] -= self.x_sum / normalizer

        # Multiply the observation by the discount compensator. Basically we
        # make this observation look "younger" than the previous ones. The
        # actual discount is applied in the reevaluation (and when solving the
        # equations in the case of TONGA) by multiplying every direction with
        # the same aging factor.
        rn = pow(self.gamma, -0.5*(self.minibatch_index+1));
        self.Xt[row] *= rn

        # Update the Gram Matrix.
        # The column.
        self.G[:row+1,row] = numpy.dot(self.Xt[:row+1,:],
                                       self.Xt[row,:].transpose())
        # The symetric row.
        # There are row+1 values, but the diag doesn't need to get copied.
        self.G[row,:row] = self.G[:row,row].transpose()

        self.minibatch_index += 1

        if self.minibatch_index == self.minibatch_size:
            self.reevaluate()
Removes the only source from NSRunLoop and cancels thread.
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/models/pca.py/PcaOnlineEstimator.observe--crossover with--dataset/ETHPy150Open Kentzo/Power/power/darwin.py/PowerSourcesNotificationsObserver.stopPowerNotificationsThread