This is an automated email from the ASF dual-hosted git repository.

njayaram pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/madlib.git


The following commit(s) were added to refs/heads/master by this push:
     new ce4bf89  DL: Refactor code to move some constants to helper file
ce4bf89 is described below

commit ce4bf89aa7724f36df142781d01fa32ba2ac27e7
Author: Nandish Jayaram <[email protected]>
AuthorDate: Wed May 15 14:26:41 2019 -0700

    DL: Refactor code to move some constants to helper file
    
    Define MINIBATCH_OUTPUT_DEPENDENT_COLNAME_DL and
    MINIBATCH_OUTPUT_INDEPENDENT_COLNAME_DL in madlib_keras_helper.py_in
    instead of in input_data_preprocessor.py_in. Importing these from
    input_data_preprocessor was also doing other imports that are not
    necessary for madlib_keras.py_in.
    Closes #391
---
 .../postgres/modules/deep_learning/input_data_preprocessor.py_in    | 6 ++----
 src/ports/postgres/modules/deep_learning/madlib_keras.py_in         | 4 ++--
 src/ports/postgres/modules/deep_learning/madlib_keras_helper.py_in  | 6 ++++++
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git 
a/src/ports/postgres/modules/deep_learning/input_data_preprocessor.py_in 
b/src/ports/postgres/modules/deep_learning/input_data_preprocessor.py_in
index 1aa34f1..bc42f63 100644
--- a/src/ports/postgres/modules/deep_learning/input_data_preprocessor.py_in
+++ b/src/ports/postgres/modules/deep_learning/input_data_preprocessor.py_in
@@ -48,13 +48,11 @@ from madlib_keras_helper import CLASS_VALUES_COLNAME
 from madlib_keras_helper import DEPENDENT_VARNAME_COLNAME
 from madlib_keras_helper import DEPENDENT_VARTYPE_COLNAME
 from madlib_keras_helper import INDEPENDENT_VARNAME_COLNAME
+from madlib_keras_helper import MINIBATCH_OUTPUT_DEPENDENT_COLNAME_DL
+from madlib_keras_helper import MINIBATCH_OUTPUT_INDEPENDENT_COLNAME_DL
 from madlib_keras_helper import NORMALIZING_CONST_COLNAME
 from madlib_keras_helper import strip_trailing_nulls_from_class_values
 
-# These are readonly variables, do not modify
-# MADLIB-1300 Adding these variables for DL only at this time.
-MINIBATCH_OUTPUT_DEPENDENT_COLNAME_DL = "dependent_var"
-MINIBATCH_OUTPUT_INDEPENDENT_COLNAME_DL = "independent_var"
 NUM_CLASSES_COLNAME = "num_classes"
 
 class InputDataPreprocessorDL(object):
diff --git a/src/ports/postgres/modules/deep_learning/madlib_keras.py_in 
b/src/ports/postgres/modules/deep_learning/madlib_keras.py_in
index 9cda792..9abbf00 100644
--- a/src/ports/postgres/modules/deep_learning/madlib_keras.py_in
+++ b/src/ports/postgres/modules/deep_learning/madlib_keras.py_in
@@ -36,8 +36,8 @@ from keras.models import *
 from keras.optimizers import *
 from keras.regularizers import *
 import madlib_keras_serializer
-from input_data_preprocessor import MINIBATCH_OUTPUT_DEPENDENT_COLNAME_DL
-from input_data_preprocessor import MINIBATCH_OUTPUT_INDEPENDENT_COLNAME_DL
+from madlib_keras_helper import MINIBATCH_OUTPUT_DEPENDENT_COLNAME_DL
+from madlib_keras_helper import MINIBATCH_OUTPUT_INDEPENDENT_COLNAME_DL
 from madlib_keras_helper import CLASS_VALUES_COLNAME
 from madlib_keras_helper import DEPENDENT_VARTYPE_COLNAME
 from madlib_keras_helper import NORMALIZING_CONST_COLNAME
diff --git a/src/ports/postgres/modules/deep_learning/madlib_keras_helper.py_in 
b/src/ports/postgres/modules/deep_learning/madlib_keras_helper.py_in
index 171f5bd..c83f2f0 100644
--- a/src/ports/postgres/modules/deep_learning/madlib_keras_helper.py_in
+++ b/src/ports/postgres/modules/deep_learning/madlib_keras_helper.py_in
@@ -72,3 +72,9 @@ INDEPENDENT_VARNAME_COLNAME = "independent_varname"
 MODEL_ARCH_TABLE_COLNAME = "model_arch_table"
 MODEL_ARCH_ID_COLNAME = "model_arch_id"
 MODEL_DATA_COLNAME = "model_data"
+
+# Name of independent and dependent colnames in batched table.
+# These are readonly variables, do not modify.
+# MADLIB-1300 Adding these variables for DL only at this time.
+MINIBATCH_OUTPUT_DEPENDENT_COLNAME_DL = "dependent_var"
+MINIBATCH_OUTPUT_INDEPENDENT_COLNAME_DL = "independent_var"

Reply via email to