#NEWLINE# def kl_sym( self , old_dist_info_vars , new_dist_info_vars ) : #NEWLINE# #INDENT# '\n        Compute the symbolic KL divergence of two categorical distributions\n        ' #NEWLINE# old_prob_var = old_dist_info_vars [ 'prob' ] #NEWLINE# new_prob_var = old_dist_info_vars [ 'prob' ] #NEWLINE# return TT . sum ( ( old_prob_var * ( TT . log ( ( old_prob_var + TINY ) ) - TT . log ( ( new_prob_var + TINY ) ) ) ) , axis = ( - 1 ) )