#NEWLINE# def apply( self , layer , targets , outputs , purpose ) : #NEWLINE# #INDENT# "Apply to a layer and update networks's log. Purpose is supposed to be a sting such as 'train' or 'test'" #NEWLINE# hyps = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for k in self . hyperParameters : #NEWLINE# #INDENT# hyps [ k ] = getattr ( self , k ) #NEWLINE# #UNINDENT# message = ( '%s uses cost %s for %s' % ( layer . name , self . __class__ . __name__ , purpose ) ) #NEWLINE# layer . network . logLayerEvent ( layer , message , hyps ) #NEWLINE# return self . costFct ( targets , outputs )