Toggle menu

Multimodal Latent Dirichlet Allocation (MLDA)

mlda.MLDA( K, weights=None, itr=100, name="mlda", category=None, mode="learn" )

mlda.MLDA is a module for unsupervised classification based on multimodal latent Dirichlet allocation. It computes the probabilities that each data element is classified into each class. Modal features of the data are generated based on the classification. The probabilities and generated features are sent to the connected modules.


Parameter Type Description
K int Number of clusters
weights array Weight for each modality
itr int Number of iterations
name string Module name
category array Correct class labels
mode string Choose from learning mode (“learn”) or recognition mode (“recog”)



# import necessary modules
import serket as srk
import mlda
import numpy as np

data = np.loadtxt( "data.txt" )  # load data
data_category = np.loadtxt( "category.txt" )  # load correct labels

# define the modules
obs = srk.Observation( data ) # send the observation to the connected module
mlda1 = mlda.MLDA( 10, catogory=data_category )  # classify into ten classes

# construct the model
mlda1.connect( obs )  # connect obs to mlda1

mlda1.update()  # train mlda