@@ -237,7 +237,10 @@ def ValidateAlgorithmSettings(self, request, context):
237237 ):
238238 return self .set_validate_context_error (
239239 context ,
240- "Algorithm Setting {}: {} with {} type must be in range ({}, {}]" .format (
240+ (
241+ "Algorithm Setting {}: {} with {} type must be in range "
242+ "({}, {})"
243+ ).format (
241244 setting .name ,
242245 converted_value ,
243246 setting_type .__name__ ,
@@ -309,7 +312,8 @@ def GetSuggestions(self, request, context):
309312
310313 if self .is_first_run :
311314 self .logger .info (
312- ">>> First time running suggestion for {}. Random architecture will be given." .format (
315+ ">>> First time running suggestion for {}. "
316+ "Random architecture will be given." .format (
313317 experiment .experiment_name
314318 )
315319 )
@@ -319,7 +323,8 @@ def GetSuggestions(self, request, context):
319323 for _ in range (experiment .num_trials ):
320324 candidates .append (sess .run (controller_ops ["sample_arc" ]))
321325
322- # TODO: will use PVC to store the checkpoint to protect against unexpected suggestion pod restart
326+ # TODO: will use PVC to store the checkpoint to protect
327+ # against unexpected suggestion pod restart
323328 saver .save (sess , experiment .ctrl_cache_file )
324329
325330 self .is_first_run = False
@@ -331,17 +336,22 @@ def GetSuggestions(self, request, context):
331336 result = self .GetEvaluationResult (request .trials )
332337
333338 # TODO: (andreyvelich) I deleted this part, should it be handle by controller?
334- # Sometimes training container may fail and GetEvaluationResult() will return None
339+ # Sometimes training container may fail and GetEvaluationResult()
340+ # will return None
335341 # In this case, the Suggestion will:
336- # 1. Firstly try to respawn the previous trials after waiting for RESPAWN_SLEEP seconds
337- # 2. If respawning the trials for RESPAWN_LIMIT times still cannot collect valid results,
338- # then fail the task because it may indicate that the training container has errors.
342+ # 1. Firstly try to respawn the previous trials after waiting for
343+ # RESPAWN_SLEEP seconds
344+ # 2. If respawning the trials for RESPAWN_LIMIT times still cannot
345+ # collect valid results,
346+ # then fail the task because it may indicate that the training
347+ # container has errors.
339348 if result is None :
340349 self .logger .warning (
341350 ">>> Suggestion has spawned trials, but they all failed."
342351 )
343352 self .logger .warning (
344- ">>> Please check whether the training container is correctly implemented"
353+ ">>> Please check whether the training container "
354+ "is correctly implemented"
345355 )
346356 self .logger .info (
347357 ">>> Experiment {} failed" .format (
@@ -351,7 +361,8 @@ def GetSuggestions(self, request, context):
351361 return []
352362
353363 # This LSTM network is designed to maximize the metrics
354- # However, if the user wants to minimize the metrics, we can take the negative of the result
364+ # However, if the user wants to minimize the metrics,
365+ # we can take the negative of the result
355366
356367 if experiment .opt_direction == api_pb2 .MINIMIZE :
357368 result = - result
@@ -426,9 +437,8 @@ def GetSuggestions(self, request, context):
426437 nn_config_str = str (nn_config_json ).replace ('"' , "'" )
427438
428439 self .logger .info (
429- "\n >>> New Neural Network Architecture Candidate #{} (internal representation):" .format (
430- i
431- )
440+ "\n >>> New Neural Network Architecture Candidate #{} "
441+ "(internal representation):" .format (i )
432442 )
433443 self .logger .info (organized_arc_json )
434444 self .logger .info ("\n >>> Corresponding Seach Space Description:" )
0 commit comments