#NEWLINE# @ classmethod #NEWLINE# def _Q( cls , X , W , H , eps = 1e-08 ) : #NEWLINE# #INDENT# "Computes X / (WH)\n           where '/' is element-wise and WH is a matrix product.\n        " #NEWLINE# if sp . issparse ( X ) : #NEWLINE# #INDENT# WH = _special_sparse_dot ( W , H , X ) #NEWLINE# WH . data = ( ( X . data + eps ) / ( WH . data + eps ) ) #NEWLINE# return WH #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return np . divide ( ( X + eps ) , ( np . dot ( W , H ) + eps ) )