#NEWLINE# def test_TrainingUserDefined( self ) : #NEWLINE# #INDENT# self . counter = 0 #NEWLINE# def terminate( **_ ) : #NEWLINE# #INDENT# self . counter += 1 #NEWLINE# return False #NEWLINE# #UNINDENT# ( a_in , a_out ) = ( numpy . zeros ( ( 8 , 16 ) ) , numpy . zeros ( ( 8 , 4 ) ) ) #NEWLINE# self . nn = MLP ( layers = [ L ( 'Linear' ) ] , n_iter = 100 , n_stable = None , callback = { #NEWLINE# #INDENT# 'on_epoch_finish' : terminate , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . nn . _fit ( a_in , terminate ) #NEWLINE# assert_equals ( self . counter , 1 )