#NEWLINE# def on_batch_end( self , batch , logs = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# batch_size = logs . get ( 'size' , 0 ) #NEWLINE# self . seen += batch_size #NEWLINE# for ( k , v ) in logs . items ( ) : #NEWLINE# #INDENT# if ( k in self . totals ) : #NEWLINE# #INDENT# self . totals [ k ] += ( v * batch_size ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . totals [ k ] = ( batch * batch_size )