kaknikhil commented on a change in pull request #368: DL: Add alternative 
options for compile params
URL: https://github.com/apache/madlib/pull/368#discussion_r275472676
 
 

 ##########
 File path: src/ports/postgres/modules/deep_learning/madlib_keras_wrapper.py_in
 ##########
 @@ -120,15 +122,27 @@ def parse_compile_params(str_of_args):
     compile_dict['metrics'] = ast.literal_eval(compile_dict['metrics']) if 
'metrics' in compile_dict.keys() else None
 
 Review comment:
   IMO this function is getting a bit too complicated to read and maintain.  
Here are some suggestions
   
   1. Not returning 3 values from this function might make it easier to read 
and maintain.
   1. Maybe create a function for `ast.literal_eval(compile_dict['']) if '' in 
compile_dict.keys() else None` and then use it for metrics and loss_weights
   1. Consider decoupling the optimizer and loss logic. 
   1. Since there are no plpy operations, we should definitely think about 
adding unit tests.
   1. docstring 
   
   I will leave it up to you to review these suggestions and maybe we can 
create a new PR later. 

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