You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@madlib.apache.org by GitBox <gi...@apache.org> on 2019/04/26 17:33:04 UTC

[GitHub] [madlib] orhankislal commented on a change in pull request #372: DL: Trap unsupported options for compile and fit params

orhankislal commented on a change in pull request #372: DL: Trap unsupported options for compile and fit params
URL: https://github.com/apache/madlib/pull/372#discussion_r279039437
 
 

 ##########
 File path: src/ports/postgres/modules/deep_learning/madlib_keras_wrapper.py_in
 ##########
 @@ -199,7 +215,34 @@ def get_optimizers():
 def compile_model(model, compile_params):
     optimizers = get_optimizers()
     (opt_name,final_args,compile_dict) = parse_compile_params(compile_params)
-    optimizer = optimizers[opt_name](**final_args) if final_args else opt_name
-    model.compile(optimizer=optimizer,
-                  loss=compile_dict['loss'],
-                  metrics=compile_dict['metrics'])
+    compile_dict['optimizer'] = optimizers[opt_name](**final_args) if final_args else opt_name
+    validate_compile_params(compile_dict)
+    model.compile(**compile_dict)
+
+def validate_compile_params(compile_dict):
+    _assert(compile_dict['metrics'] is None or type(compile_dict['metrics']) is list,
+            "wrong input type for compile parameter metrics: multi-output model"
+            "is not supported yet, please pass a list")
 
 Review comment:
   Keras accepts a dict as `metrics` if you are building a multi-output model (that we don't support yet). 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services