예제 #1
0
파일: imm.py 프로젝트: Garyfallidis/nipy
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 
예제 #2
0
파일: imm.py 프로젝트: matthew-brett/nipy
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
예제 #3
0
파일: imm.py 프로젝트: sashka/nipy
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