khannaekta commented on a change in pull request #513:
URL: https://github.com/apache/madlib/pull/513#discussion_r485862374



##########
File path: src/ports/postgres/modules/deep_learning/madlib_keras_automl.py_in
##########
@@ -138,3 +157,406 @@ class HyperbandSchedule():
                                       r_i_col=AutoMLSchema.RESOURCES,
                                       **locals())
             plpy.execute(insert_query)
+
+@MinWarning("warning")
+class KerasAutoML():
+    """The core AutoML function for running AutoML algorithms such as 
Hyperband.
+    This function executes the hyperband rounds 'diagonally' to evaluate 
multiple configurations together
+    and leverage the compute power of MPP databases such as Greenplum.
+    """
+    def __init__(self, schema_madlib, source_table, model_output_table, 
model_arch_table, model_selection_table,
+                 model_id_list, compile_params_grid, fit_params_grid, 
automl_method='hyperband',
+                 automl_params='R=6, eta=3, skip_last=0', random_state=None, 
object_table=None,
+                 use_gpus=False, validation_table=None, 
metrics_compute_frequency=None,
+                 name=None, description=None, **kwargs):
+        self.schema_madlib = schema_madlib

Review comment:
       We should explicitly check for the params passed in as None to be set to 
the Default value for `automl_method `, `automl_params ` and  `use_gpus `. This 
is valid when we only want to pass in the  `object_table` for a custome loss 
function but we want the default automl_params, automl_method to be used.
   Else it fails as follows: 
   ```
   SELECT madlib_keras_automl('iris_data_packed', 'automl_output', 
'iris_model_arch', 'automl_mst_table',                                          
                                                     ARRAY[1,2], $${'loss': 
['test_custom_fn1'], 'optimizer_params_list': [ {'optimizer': ['Adagrad', 
'Adam'],                                                                        
                         'lr': [0.9, 0.95, 'log'], 'epsilon': [0.3, 0.5, 
'log_near_one']}, {'optimizer': ['Adam', 'SGD'],                                
                                                                          'lr': 
[0.6, 0.65, 'log']} ], 'metrics':['accuracy'] }$$, $${'batch_size': [2, 4], 
'epochs': [3]}$$, NULL, NULL, NULL, 'test_custom_function_table', NULL);
   ERROR:  AttributeError: 'NoneType' object has no attribute 'lower' 
(plpy_elog.c:121)
   CONTEXT:  Traceback (most recent call last):
     PL/Python function "madlib_keras_automl", line 21, in <module>
       schedule_loader = madlib_keras_automl.KerasAutoML(**globals())
     PL/Python function "madlib_keras_automl", line 42, in wrapper
     PL/Python function "madlib_keras_automl", line 200, in __init__
     PL/Python function "madlib_keras_automl", line 257, in 
validate_and_define_inputs
   PL/Python function "madlib_keras_automl"
   ```




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


Reply via email to