#NEWLINE# def forward( self , doc , wrd , window = 5 ) : #NEWLINE# #INDENT# ( doc , wrd ) = utils . move ( self . xp , doc , wrd ) #NEWLINE# proportions = self . proportions ( doc ) #NEWLINE# ld = dirichlet_likelihood ( self . proportions . W ) #NEWLINE# context = F . matmul ( F . softmax ( proportions ) , self . factors ( ) ) #NEWLINE# loss = self . loss_func ( context , wrd ) #NEWLINE# return ( loss , ld )