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_r279049168
##########
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:
The keras documentation indicates that it should be a list. Taken from
https://keras.io/models/model/
```
Typically you will use metrics=['accuracy']
```
----------------------------------------------------------------
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