#NEWLINE# def continuous_loss( self , y , y_hat ) : #NEWLINE# #INDENT# if ( y . ndim == 2 ) : #NEWLINE# #INDENT# raise ValueError ( 'FIXME!' ) #NEWLINE# #UNINDENT# gx = np . indices ( y . shape ) #NEWLINE# result = ( 1 - y [ ( gx , y ) ] ) #NEWLINE# if hasattr ( self , 'class_weight' ) : #NEWLINE# #INDENT# return np . sum ( ( self . class_weight [ y ] * result ) ) #NEWLINE# #UNINDENT# return np . sum ( result )