def __call__(self, X):
        """
        Compute for each sample its probability to belong to a cluster.

        Parameters
        ----------
        X : numpy.ndarray
            Matrix of sampless of shape (n, d)

        Returns
        -------
        WRITEME
        """
        n, m = X.shape
        k = self.k
        mu = self.mu
        dists = numpy.zeros((n, k))
        for i in xrange(k):
            dists[:, i] = numpy.square((X - mu[i, :])).sum(axis=1)
        return dists / dists.sum(axis=1).reshape(-1, 1)
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/models/kmeans.py/KMeans.__call__/original