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

commit 94effc885349a71363e0bc1be9946219696588b6
Author: Jingyi Mei <[email protected]>
AuthorDate: Wed Mar 13 12:00:58 2019 -0700

    Deep Learning: Add dev-check test cases
    
    This commit adds dev-check for the deep learning module. All test cases
    set use_gpu param to false.
    
    Co-authored-by: Nikhil Kak <[email protected]>
---
 .../modules/convex/test/madlib_keras.sql_in        | 54 ++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/src/ports/postgres/modules/convex/test/madlib_keras.sql_in 
b/src/ports/postgres/modules/convex/test/madlib_keras.sql_in
new file mode 100644
index 0000000..58359c7
--- /dev/null
+++ b/src/ports/postgres/modules/convex/test/madlib_keras.sql_in
@@ -0,0 +1,54 @@
+/* ----------------------------------------------------------------------- 
*//**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *//* ----------------------------------------------------------------------- 
*/
+
+drop table if exists cifar_10_sample;
+create table cifar_10_sample(
+               id INTEGER,
+               x  REAL[],
+        y SMALLINT,
+        imgpath TEXT
+        );
+copy cifar_10_sample from stdin delimiter '|';
+1|{{{202,204,199},{202,204,199},{204,206,201},{206,208,203},{208,210,205},{209,211,206},{210,212,207},{212,214,210},{213,215,212},{215,217,214},{216,218,215},{216,218,215},{215,217,214},{216,218,215},{216,218,215},{216,218,214},{217,219,214},{217,219,214},{218,220,215},{218,219,214},{216,217,212},{217,218,213},{218,219,214},{214,215,209},{213,214,207},{212,213,206},{211,212,205},{209,210,203},{208,209,202},{207,208,200},{205,206,199},{203,204,198}},{{206,208,203},{206,208,203},{207,209,2
 [...]
+2|{{{126,118,110},{122,115,108},{126,119,111},{127,119,109},{130,122,111},{130,122,111},{132,124,113},{133,125,114},{130,122,111},{132,124,113},{134,126,115},{131,123,112},{131,123,112},{134,126,115},{133,125,114},{136,128,117},{137,129,118},{137,129,118},{136,128,117},{131,123,112},{130,122,111},{132,124,113},{132,124,113},{132,124,113},{129,122,110},{127,121,109},{127,121,109},{125,119,107},{124,118,106},{124,118,106},{120,114,102},{117,111,99}},{{122,115,107},{119,112,104},{121,114,10
 [...]
+\.
+
+DROP TABLE IF EXISTS cifar_10_sample_batched;
+DROP TABLE IF EXISTS cifar_10_sample_batched_summary;
+SELECT 
minibatch_preprocessor_dl('cifar_10_sample','cifar_10_sample_batched','y','x', 
2);
+
+DROP TABLE IF EXISTS model_arch;
+SELECT load_keras_model('model_arch', $${"class_name": "Sequential", 
"keras_version": "2.1.6", "config": [{"class_name": "Conv2D", "config": 
{"kernel_initializer": {"class_name": "VarianceScaling", "config": 
{"distribution": "uniform", "scale": 1.0, "seed": null, "mode": "fan_avg"}}, 
"name": "conv2d_1", "kernel_constraint": null, "bias_regularizer": null, 
"bias_constraint": null, "dtype": "float32", "activation": "relu", "trainable": 
true, "data_format": "channels_last", "filters": 32, " [...]
+ALTER TABLE model_arch RENAME model_id TO id;
+
+DROP TABLE IF EXISTS keras_out, keras_out_summary;
+SELECT madlib_keras_fit('cifar_10_sample_batched',
+                                                               'keras_out',
+                                                               'dependent_var',
+                                                               
'independent_var',
+                                                               'model_arch',
+                                                               1,
+                                                               
'''optimizer''=SGD(lr=0.01, decay=1e-6, nesterov=True), 
''loss''=''categorical_crossentropy'', ''metrics''=[''accuracy'']'::text,
+                                                               
'''batch_size''=2, ''epochs''=1, ''verbose''=0'::text,
+                                                               2,
+                                                               10,
+                                                               FALSE,
+                                                               
'cifar_10_sample_batched');

Reply via email to