khannaekta commented on a change in pull request #443: DL: Add training for 
multiple models
URL: https://github.com/apache/madlib/pull/443#discussion_r327883356
 
 

 ##########
 File path: 
src/ports/postgres/modules/deep_learning/test/madlib_keras_model_selection.sql_in
 ##########
 @@ -158,3 +133,180 @@ SELECT assert(
 )
 FROM mst_table;
 
+m4_changequote(`<!', `!>')
+m4_ifdef(<!__POSTGRESQL__!>, <!!>, <!
+-- Multiple models test
+-- Prepare model selection table with three rows
+DROP TABLE IF EXISTS mst_table, mst_table_summary;
+SELECT load_model_selection_table(
+    'iris_model_arch',
+    'mst_table',
+    ARRAY[1],
+    ARRAY[
+        $$loss='categorical_crossentropy', optimizer='Adam(lr=0.01)', 
metrics=['accuracy']$$,
+        $$loss='categorical_crossentropy', optimizer='Adam(lr=0.001)', 
metrics=['accuracy']$$,
+        $$loss='categorical_crossentropy', optimizer='Adam(lr=0.0001)', 
metrics=['accuracy']$$
+    ],
+    ARRAY[
+        $$batch_size=50, epochs=1$$
+    ]
+);
+-- Prepare model selection table with only one row
+DROP TABLE IF EXISTS mst_table_1row, mst_table_1row_summary;
+SELECT load_model_selection_table(
+    'iris_model_arch',
+    'mst_table_1row',
+    ARRAY[1],
+    ARRAY[
+        $$loss='categorical_crossentropy', optimizer='Adam(lr=0.01)', 
metrics=['accuracy']$$
+    ],
+    ARRAY[
+        $$batch_size=16, epochs=1$$
+    ]
+);
+-- Prepare model selection table with four rows
+DROP TABLE IF EXISTS mst_table_4row, mst_table_4row_summary;
+SELECT load_model_selection_table(
+    'iris_model_arch',
+    'mst_table_4row',
+    ARRAY[1],
+    ARRAY[
+        $$loss='categorical_crossentropy', optimizer='Adam(lr=0.01)', 
metrics=['accuracy']$$,
+        $$loss='categorical_crossentropy', optimizer='Adam(lr=0.001)', 
metrics=['accuracy']$$
+    ],
+    ARRAY[
+        $$batch_size=16, epochs=1$$,
+        $$batch_size=32, epochs=1$$
+    ]
+);
+
+-- Test when number of configs(3) equals number of segments(3)
 
 Review comment:
   Getting the information about the number of segment should be easy 
`gp_segment_configuration`, but the tricky part is creating the rows in the 
`mst_tables` to match the number of segments. 
   For this PR, we can probably keep this assumption and maybe do it as a 
separate task. 

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