Пример #1
0
def main():
    obs1 = srk.Observation(np.loadtxt("data000.txt"))
    obs2 = srk.Observation(np.loadtxt("data001.txt"))
    obs3 = srk.Observation(np.loadtxt("data002.txt"))
    obs4 = srk.Observation(np.loadtxt("data003.txt"))
    obs5 = srk.Observation(np.loadtxt("data004.txt"))

    category = np.loadtxt("data_category.txt")

    mlda1 = mlda.MLDA(10, [100], category=category)
    mlda2 = mlda.MLDA(10, [100, 100], category=category)
    mlda3 = mlda.MLDA(10, [100, 100], category=category)
    mlda4 = mlda.MLDA(10, [100, 100], category=category)
    mlda5 = mlda.MLDA(10, [100, 100], category=category)

    mlda1.connect(obs1)
    mlda2.connect(mlda1, obs2)
    mlda3.connect(mlda2, obs3)
    mlda4.connect(mlda3, obs4)
    mlda5.connect(mlda4, obs5)

    for it in range(5):
        mlda1.update()
        mlda2.update()
        mlda3.update()
        mlda4.update()
        mlda5.update()
Пример #2
0
def main():
    obs1 = srk.Observation(np.loadtxt("data1.txt"))
    obs2 = srk.Observation(np.loadtxt("data2.txt"))
    category = np.loadtxt("category.txt")

    vae1 = vae_model(10, epoch=200, batch_size=500)
    gmm1 = gmm.GMM(10, category=category)
    nn1 = NN_model(itr1=500, itr2=2000, batch_size1=500, batch_size2=500)

    vae1.connect(obs1)
    gmm1.connect(vae1)
    nn1.connect(gmm1, obs2)

    for i in range(10):
        print(i)
        vae1.update()
        gmm1.update()
        nn1.update()
Пример #3
0
def main():
    obs1 = srk.Observation(np.loadtxt("data1.txt"))
    obs2 = srk.Observation(np.loadtxt("data2.txt"))
    data_category = np.loadtxt("category.txt")

    vae1 = vae_model(18, epoch=200, batch_size=500)
    gmm1 = gmm.GMM(10, category=data_category)
    mlda1 = mlda.MLDA(10, [200, 200], category=data_category)

    vae1.connect(obs1)
    gmm1.connect(vae1)
    mlda1.connect(obs2, gmm1)

    for i in range(5):
        print(i)
        vae1.update()
        gmm1.update()
        mlda1.update()
Пример #4
0
def main():
    obs1 = srk.Observation(np.loadtxt("dsift.txt"))  # 視覚
    obs2 = srk.Observation(np.loadtxt("mfcc.txt"))  # 聴覚
    obs3 = srk.Observation(np.loadtxt("tactile.txt"))  # 触覚
    obs4 = srk.Observation(np.loadtxt("angle.txt"))  # 関節角

    object_category = np.loadtxt("object_category.txt")
    motion_category = np.loadtxt("motion_category.txt")

    mlda1 = mlda.MLDA(10, [200, 200, 200], category=object_category)
    mlda2 = mlda.MLDA(10, [200], category=motion_category)
    mlda3 = mlda.MLDA(10, [100, 100])

    mlda1.connect(obs1, obs2, obs3)
    mlda2.connect(obs4)
    mlda3.connect(mlda1, mlda2)

    for it in range(5):
        print(it)
        mlda1.update()
        mlda2.update()
        mlda3.update()
Пример #5
0
def main():
    obs = srk.Observation(np.loadtxt("data.txt"))
    data_category = np.loadtxt("category.txt")

    vae1 = vae_model(18, epoch=200, batch_size=500)
    gmm1 = gmm.GMM(10, category=data_category)

    vae1.connect(obs)
    gmm1.connect(vae1)

    for i in range(5):
        print(i)
        vae1.update()
        gmm1.update()
Пример #6
0
def main():
    obs1 = CNN.CNNFeatureExtractor( ["images/%03d.png"%i for i in range(6)] )
    obs2 = srk.Observation( np.loadtxt("histogram_w.txt") )

    mlda1 = mlda.MLDA(3, [1000])
    mlda2 = mlda.MLDA(3, [50])
    mlda3 = mlda.MLDA(3, [50,50])
    
    mlda1.connect( obs1 )
    mlda2.connect( obs2 )
    mlda3.connect( mlda1, mlda2 )
    
    for it in range(5):
        mlda1.update()
        mlda2.update()
        mlda3.update()
Пример #7
0
def main():
    obs = srk.Observation(np.loadtxt("data.txt"))
    data_category = np.loadtxt("category.txt")

    vae1 = vae.VAE(18, itr=200, batch_size=500)
    gmm1 = gmm.GMM(10, category=data_category)
    mm1 = mm.MarkovModel()

    vae1.connect(obs)
    gmm1.connect(vae1)
    mm1.connect(gmm1)

    for i in range(5):
        print(i)
        vae1.update()
        gmm1.update()
        mm1.update()
Пример #8
0
def main():
    obs = srk.Observation(np.loadtxt("data.txt"))
    correct_classes = np.loadtxt("correct.txt")

    # GMM単体
    g = gmm.GMM(4, category=correct_classes)
    g.connect(obs)
    g.update()

    # GMMとマルコフモデルを結合したモデル
    g = gmm.GMM(4, category=correct_classes)
    m = mm.MarkovModel()

    g.connect(obs)
    m.connect(g)

    for itr in range(5):
        g.update()
        m.update()