orhankislal commented on a change in pull request #511:
URL: https://github.com/apache/madlib/pull/511#discussion_r467319744
##########
File path: src/ports/postgres/modules/deep_learning/madlib_keras_wrapper.py_in
##########
@@ -325,8 +326,19 @@ def compile_model(model, compile_params,
custom_function_map=None):
optimizers = get_optimizers()
(opt_name,final_args,compile_dict) =
parse_and_validate_compile_params(compile_params)
if custom_function_map is not None:
- map=dill.loads(custom_function_map)
- compile_dict['loss']=map[compile_dict['loss']]
+ local_map=dill.loads(custom_function_map)
+
+ compile_dict['loss']=local_map[compile_dict['loss']] \
+ if compile_dict['loss'] in local_map else compile_dict['loss']
+
+ new_metrics = []
+ for i in compile_dict['metrics']:
Review comment:
I know that the `compile_dict['metrics']` is an array of a single
element but in case we support multiple metrics this code would be useful so I
prefer leaving it as is.
----------------------------------------------------------------
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]