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_r286268486
 
 

 ##########
 File path: src/ports/postgres/modules/deep_learning/madlib_keras.py_in
 ##########
 @@ -637,13 +642,21 @@ def internal_keras_eval_transition(state, dependent_var, 
independent_var,
     with K.tf.device(device_name):
         res = model.evaluate(x_val, y_val)
 
-    loss, metric = res
+    # if metric is None, model.evaluate will only return loss as a scalar
+    # Otherwise, it will return a list which has loss and metric
+    if type(res) is list:
+        loss, metric = res
+    else:
+        loss = res
+        metric = None
 
     image_count = len(dependent_var)
 
     agg_image_count += image_count
     agg_loss += (image_count * loss)
-    agg_metric += (image_count * metric)
+    plpy.info("agg_metric is {}".format(agg_metric))
 
 Review comment:
   again do we need this information to be printed to the console ? there are a 
few more plpy infos that need to be removed.

----------------------------------------------------------------
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