#NEWLINE# def run( self ) : #NEWLINE# #INDENT# '\n        Run the desired number of training epochs, a testing epoch\n        is conducted after each training epoch.\n        ' #NEWLINE# for epoch in range ( 1 , ( self . num_epochs + 1 ) ) : #NEWLINE# #INDENT# self . run_epoch ( epoch , epoch . epoch_length ) #NEWLINE# self . agent . finish_epoch ( epoch ) #NEWLINE# if ( self . test_length > 0 ) : #NEWLINE# #INDENT# self . agent . start_testing ( ) #NEWLINE# self . run_epoch ( epoch , self . test_length , True ) #NEWLINE# self . agent . finish_testing ( epoch )