njayaram2 commented on a change in pull request #385: DL: Make metrics and loss
optional compile parameters
URL: https://github.com/apache/madlib/pull/385#discussion_r281880025
##########
File path: src/ports/postgres/modules/deep_learning/madlib_keras_wrapper.py_in
##########
@@ -213,27 +215,22 @@ def parse_optimizer(compile_dict):
final_args[key] = float(value)
return (opt_name,final_args)
-# Parse the loss function.
-def parse_loss(compile_dict):
- loss_split = compile_dict['loss'].split('.')
- if (len(loss_split) == 2 and
- loss_split[0] == 'losses' and
- loss_split[1] in dir(losses)):
- return eval('losses.'+loss_split[1])
- return compile_dict['loss']
-
# Parse the fit parameters into a dictionary.
def parse_and_validate_fit_params(fit_param_str):
- fit_params_dict = convert_string_of_args_to_dict(fit_param_str)
- literal_eval_fit_params = ['batch_size','epochs','verbose','shuffle',
- 'class_weight','initial_epoch','steps_per_epoch']
- accepted_fit_params = literal_eval_fit_params + ['shuffle']
+ if fit_param_str:
+ fit_params_dict = convert_string_of_args_to_dict(fit_param_str)
- fit_params_dict = validate_and_literal_eval_keys(fit_params_dict,
- literal_eval_fit_params,
- accepted_fit_params)
- return fit_params_dict
+ literal_eval_fit_params = ['batch_size','epochs','verbose','shuffle',
+
'class_weight','initial_epoch','steps_per_epoch']
+ accepted_fit_params = literal_eval_fit_params + ['shuffle']
Review comment:
What is the difference between `literal_eval_fit_params` and
`accepted_fit_params`? `shuffle` is already in `literal_eval_fit_params`.
----------------------------------------------------------------
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