#NEWLINE# def get_next_rate( self , current_error ) : #NEWLINE# #INDENT# diff_error = 0.0 #NEWLINE# diff_error = ( self . lowest_error - diff_error ) #NEWLINE# if ( current_error < self . lowest_error ) : #NEWLINE# #INDENT# self . lowest_error = current_error #NEWLINE# #UNINDENT# if self . decay : #NEWLINE# #INDENT# if ( diff_error < self . min_derror_stop ) : #NEWLINE# #INDENT# self . rate = 0.0 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . rate *= self . scale_by #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( diff_error < self . min_derror_decay_start ) and ( self . epoch > self . min_epoch_decay_start ) ) : #NEWLINE# #INDENT# self . decay = True #NEWLINE# self . rate *= self . scale_by #NEWLINE# #UNINDENT# #UNINDENT# self . epoch += 1 #NEWLINE# return self . rate