kaknikhil 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_r279020200
##########
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:
1. I am confused by the `multi-output model` error message. Can you explain?
1. Should both of these conditions throw the same error message ? This also
applies to all the other asserts in this function
1. Keras allows user to pass in a custom metric but we can't support it. We
should add this to the docs
----------------------------------------------------------------
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