#NEWLINE# def __init__( self , counts , n_docs , n_topics , n_dim , n_vocab , n_samples = 5 ) : #NEWLINE# #INDENT# factors = np . random . random ( ( n_topics , n_dim ) ) . astype ( 'float32' ) #NEWLINE# loss_func = L . NegativeSampling ( n_dim , counts , n_samples ) #NEWLINE# loss_func . W . data [ : , : ] = np . random . randn ( * loss_func . W . data . shape ) #NEWLINE# loss_func . W . data [ : , : ] /= np . sqrt ( np . prod ( loss_func . W . data . shape ) ) #NEWLINE# super ( NSLDA , self ) . __init__ ( proportions = L . EmbedID ( n_docs , n_topics ) , factors = L . Parameter ( factors ) , loss_func = loss_func ) #NEWLINE# self . n_docs = n_docs #NEWLINE# self . n_topics = n_topics #NEWLINE# self . n_vocab = n_vocab #NEWLINE# self . n_dim = n_dim