kaknikhil commented on a change in pull request #393: DL: Add support for 
reporting various metrics in fit/evaluate
URL: https://github.com/apache/madlib/pull/393#discussion_r285699186
 
 

 ##########
 File path: src/ports/postgres/modules/deep_learning/madlib_keras.py_in
 ##########
 @@ -342,23 +330,24 @@ def compute_loss_and_metrics(schema_madlib, table, 
dependent_varname,
     given dataset (table.)
     """
     start_val = time.time()
-    evaluate_result = get_loss_acc_from_keras_eval(schema_madlib,
-                                                   table,
-                                                   dependent_varname,
-                                                   independent_varname,
-                                                   compile_params,
-                                                   model_arch, model_state,
-                                                   gpus_per_host,
-                                                   segments_per_host,
-                                                   seg_ids_val,
-                                                   rows_per_seg_val,
-                                                   gp_segment_id_col)
+    evaluate_result = get_loss_metric_from_keras_eval(schema_madlib,
+                                                      table,
+                                                      dependent_varname,
+                                                      independent_varname,
+                                                      compile_params,
+                                                      model_arch,
+                                                      model_state,
+                                                      gpus_per_host,
+                                                      segments_per_host,
+                                                      seg_ids_val,
+                                                      rows_per_seg_val,
+                                                      gp_segment_id_col)
     end_val = time.time()
     plpy.info("Time for evaluation in iteration {0}: {1} sec.". format(
         curr_iter, end_val - start_val))
-    if len(evaluate_result) < 2:
-        plpy.error('Calling evaluate on table {0} returned < 2 '
-                   'metrics. Expected both loss and a metric.'.format(
+    if len(evaluate_result) not in [1, 2]:
 
 Review comment:
   Since metric can be an optional param, isn't it possible that keras.eval 
only returns the loss ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to