#NEWLINE# def get_loss( self , input = None , target = None , * args , **kwargs ) : #NEWLINE# #INDENT# network_output = self . input_layer . get_output ( input , * args , ** kwargs ) #NEWLINE# if ( target is None ) : #NEWLINE# #INDENT# target = self . target_var #NEWLINE# #UNINDENT# if ( self . mode == 'soft' ) : #NEWLINE# #INDENT# aux_target = network_output #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( target . mode == 'hard' ) : #NEWLINE# #INDENT# aux_target = nn . utils . one_hot ( T . argmax ( network_output , axis = 1 ) , m = 121 ) #NEWLINE# #UNINDENT# #UNINDENT# target = ( ( self . beta * target ) + ( ( 1 - self . beta ) * aux_target ) ) #NEWLINE# return log_loss ( network_output , target )