#NEWLINE# def entropy_hs( self , H_hat , var_s0_hat , var_s1_hat ) : #NEWLINE# #INDENT# '\n        .. todo::\n\n            WRITEME\n        ' #NEWLINE# half = as_floatX ( 0.5 ) #NEWLINE# one = as_floatX ( 1.0 ) #NEWLINE# two = as_floatX ( 2.0 ) #NEWLINE# pi = as_floatX ( np . pi ) #NEWLINE# for H_hat_v in get_debug_values ( H_hat ) : #NEWLINE# #INDENT# assert ( H_hat_v . min ( ) >= 0.0 ) #NEWLINE# assert ( H_hat_v . max ( ) <= 1.0 ) #NEWLINE# #UNINDENT# term1_plus_term2 = self . entropy_h ( H_hat ) #NEWLINE# assert ( len ( term1_plus_term2 . type . broadcastable ) == 1 ) #NEWLINE# term3 = T . sum ( ( H_hat * ( half * ( ( T . log ( var_s1_hat ) + T . log ( ( two * pi ) ) ) + one ) ) ) , axis = 1 ) #NEWLINE# assert ( len ( term3 . type . broadcastable ) == 1 ) #NEWLINE# term4 = T . dot ( ( 1.0 - H_hat ) , ( half * ( ( T . log ( var_s0_hat ) + T . log ( ( two * pi ) ) ) + one ) ) ) #NEWLINE# assert ( len ( term4 . type . broadcastable ) == 1 ) #NEWLINE# for ( t12 , t3 , t4 ) in get_debug_values ( term1_plus_term2 , term3 , term4 ) : #NEWLINE# #INDENT# debug_assert ( ( not contains_nan ( t12 ) ) ) #NEWLINE# debug_assert ( ( not contains_nan ( t3 ) ) ) #NEWLINE# debug_assert ( ( not contains_nan ( t4 ) ) ) #NEWLINE# #UNINDENT# rval = ( ( term1_plus_term2 + term3 ) + term4 ) #NEWLINE# assert ( len ( term3 . type . broadcastable ) == 1 ) #NEWLINE# return rval