def __init__(self, X):
        assert X.ndim == 2 and (X >= 0).all()

        self.N, self.K = X.shape
        # Compute the empirical name probabilities for each row
        alpha = 1
        self.pi = (X+alpha).astype(np.float) / (X+alpha).sum(axis=1)[:,None]

        self.multinomials = []
        for pi_n in self.pi:
            self.multinomials.append(Multinomial(weights=pi_n, K=self.K))
dataset/ETHPy150Open HIPS/pgmult/pgmult/distributions.py/IndependentMultinomialsModel.__init__/original