def stopping_criteria(num_iterations, validation_error, training_error):
 if ((num_iterations % 100) == 0):
  if VERBOSE:
   print(('error: %s' % validation_error))
 if (num_iterations >= 2000):
  return True
 return False

def stopping_criteria ( num_iterations , validation_error , training_error ) : if ( ( num_iterations % 100 ) == 0 ) : if VERBOSE : print ( ( 'error: %s' % validation_error ) ) if ( num_iterations >= 2000 ) : return True return False
define when to stop iterating .