def main(): n = 100 dim = 3 alpha = .5 aff = np.random.randn(dim, dim) x = np.dot(np.random.randn(n, dim), aff) igmm = IMM(alpha, dim) igmm.set_priors(x) # warming igmm.sample(x, niter=100, kfold=10) print 'number of components: ', igmm.k # print 'number of components: ', igmm.k if dim<3: from gmm import plot2D plot2D(x, igmm, verbose=1) return igmm
def main(): """ Illustrative example of the behaviour of imm """ n = 100 dim = 2 alpha = .5 aff = np.random.randn(dim, dim) x = np.dot(np.random.randn(n, dim), aff) igmm = IMM(alpha, dim) igmm.set_priors(x) # warming igmm.sample(x, niter=100, kfold=10) print('number of components: ', igmm.k) # print('number of components: ', igmm.k) if dim < 3: from gmm import plot2D plot2D(x, igmm, verbose=1) return igmm
def main(): """ Illustrative example of the behaviour of imm """ n = 100 dim = 2 alpha = .5 aff = np.random.randn(dim, dim) x = np.dot(np.random.randn(n, dim), aff) igmm = IMM(alpha, dim) igmm.set_priors(x) # warming igmm.sample(x, niter=100, kfold=10) print 'number of components: ', igmm.k # print 'number of components: ', igmm.k if dim < 3: from gmm import plot2D plot2D(x, igmm, verbose=1) return igmm