예제 #1
0
파일: mMLDA2.py 프로젝트: naka-lab/Serket
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 = 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()
예제 #3
0
def main():
    wavs = ["0_jackson_0.wav", "0_jackson_1.wav", "0_jackson_2.wav","1_jackson_0.wav", "1_jackson_1.wav", "1_jackson_2.wav", "2_jackson_0.wav", "2_jackson_1.wav", "2_jackson_2.wav"]
    obs1 = hac.HACFeatureExtractor(wavs, [1,1,1])
    

    mlda1 = mlda.MLDA(3, [200], category=[0,0,0,1,1,1,2,2,2])
    
    mlda1.connect( obs1 )
    
    for it in range(1):
        print( it )
        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():
    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()
예제 #6
0
    def main():

        X = pd.read_csv('mfeat-mor', delim_whitespace=True, header=None)
        Y = pd.read_csv('mfeat-pix', delim_whitespace=True, header=None)

        Y = Y[:10]
        X = X[:10]
        Y.drop(Y.iloc[:, 7:], inplace=True, axis=1)

        Y.drop(Y.iloc[:, 6:], inplace=True, axis=1)

        n = X.shape[1]
        row, col = (n, n)

        Mlda = mlda.MLDA()
        vTransforms = Mlda.fit(X, Y, row, col, n)

        print("Wx -> ")

        print(vTransforms[0])
        print()
        print("Wy -> ")
        print(vTransforms[1])