#NEWLINE# def train_epoch( self ) : #NEWLINE# #INDENT# batch_losses = [ ] #NEWLINE# for batch in self . feed . batches ( ) : #NEWLINE# #INDENT# loss = np . array ( ca . mean ( self . model . update ( * batch ) ) ) #NEWLINE# for ( param , state ) in zip ( epoch_loss . params , self . learn_rule_states ) : #NEWLINE# #INDENT# self . learn_rule . step ( param , state ) #NEWLINE# #UNINDENT# batch_losses . append ( loss ) #NEWLINE# #UNINDENT# epoch_loss = np . mean ( batch_losses ) #NEWLINE# return epoch_loss