[madlib-site] branch automl updated: hyperband diagonal E2E still in work...

2019-11-21 Thread fmcquillan
This is an automated email from the ASF dual-hosted git repository.

fmcquillan pushed a commit to branch automl
in repository https://gitbox.apache.org/repos/asf/madlib-site.git


The following commit(s) were added to refs/heads/automl by this push:
 new c606abc  hyperband diagonal E2E still in work...
c606abc is described below

commit c606abcf87684808eaa68fc47b700ae247a7f20c
Author: Frank McQuillan 
AuthorDate: Thu Nov 21 17:20:43 2019 -0800

hyperband diagonal E2E still in work...
---
 .../hyperband_diag_v2_mnist-checkpoint.ipynb   | 924 ++---
 .../automl/hyperband_diag_v2_mnist.ipynb   | 924 ++---
 2 files changed, 866 insertions(+), 982 deletions(-)

diff --git 
a/community-artifacts/Deep-learning/automl/.ipynb_checkpoints/hyperband_diag_v2_mnist-checkpoint.ipynb
 
b/community-artifacts/Deep-learning/automl/.ipynb_checkpoints/hyperband_diag_v2_mnist-checkpoint.ipynb
index 09598ea..091e6fd 100644
--- 
a/community-artifacts/Deep-learning/automl/.ipynb_checkpoints/hyperband_diag_v2_mnist-checkpoint.ipynb
+++ 
b/community-artifacts/Deep-learning/automl/.ipynb_checkpoints/hyperband_diag_v2_mnist-checkpoint.ipynb
@@ -23,7 +23,9 @@
 "\n",
 "5. Hyperband diagonal\n",
 "\n",
-"6. Plot results"
+"6. Plot results\n",
+"\n",
+"7. Print run schedules"
]
   },
   {
@@ -792,7 +794,7 @@
   },
   {
"cell_type": "code",
-   "execution_count": 6,
+   "execution_count": 17,
"metadata": {},
"outputs": [
 {
@@ -819,7 +821,7 @@
"[]"
   ]
  },
- "execution_count": 6,
+ "execution_count": 17,
  "metadata": {},
  "output_type": "execute_result"
 }
@@ -894,7 +896,7 @@
   },
   {
"cell_type": "code",
-   "execution_count": 7,
+   "execution_count": 18,
"metadata": {},
"outputs": [],
"source": [
@@ -917,344 +919,12 @@
"cell_type": "markdown",
"metadata": {},
"source": [
-"Pretty print reg Hyperband run schedule"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 7,
-   "metadata": {},
-   "outputs": [
-{
- "name": "stdout",
- "output_type": "stream",
- "text": [
-  "max_iter = 3\n",
-  "eta = 3\n",
-  "B = 2*max_iter = 6\n",
-  " \n",
-  "s=1\n",
-  "n_i  r_i\n",
-  "\n",
-  "3 1.0\n",
-  "1.0 3.0\n",
-  " \n",
-  "s=0\n",
-  "n_i  r_i\n",
-  "\n",
-  "2 3\n",
-  " \n",
-  "sum of configurations at leaf nodes across all s = 3.0\n",
-  "(if have more workers than this, they may not be 100% busy)\n"
- ]
-}
-   ],
-   "source": [
-"import numpy as np\n",
-"from math import log, ceil\n",
-"\n",
-"#input\n",
-"max_iter = 3  # maximum iterations/epochs per configuration\n",
-"eta = 3  # defines downsampling rate (default=3)\n",
-"\n",
-"logeta = lambda x: log(x)/log(eta)\n",
-"s_max = int(logeta(max_iter))  # number of unique executions of 
Successive Halving (minus one)\n",
-"B = (s_max+1)*max_iter  # total number of iterations (without reuse) per 
execution of Succesive Halving (n,r)\n",
-"\n",
-"#echo output\n",
-"print (\"max_iter = \" + str(max_iter))\n",
-"print (\"eta = \" + str(eta))\n",
-"print (\"B = \" + str(s_max+1) + \"*max_iter = \" + str(B))\n",
-"\n",
-"sum_leaf_n_i = 0 # count configurations at leaf nodes across all s\n",
-"\n",
-" Begin Finite Horizon Hyperband outlerloop. Repeat indefinitely.\n",
-"for s in reversed(range(s_max+1)):\n",
-"\n",
-"print (\" \")\n",
-"print (\"s=\" + str(s))\n",
-"print (\"n_i  r_i\")\n",
-"print (\"\")\n",
-"counter = 0\n",
-"\n",
-"n = int(ceil(int(B/max_iter/(s+1))*eta**s)) # initial number of 
configurations\n",
-"r = max_iter*eta**(-s) # initial number of iterations to run 
configurations for\n",
-"\n",
-" Begin Finite Horizon Successive Halving with (n,r)\n",
-"#T = [ get_random_hyperparameter_configuration() for i in range(n) ] 
\n",
-"for i in range(s+1):\n",
-"# Run each of the n_i configs for r_i iterations and keep best 
n_i/eta\n",
-"n_i = n*eta**(-i)\n",
-"r_i = r*eta**(i)\n",
-"\n",
-"print (str(n_i) + \" \" + str (r_i))\n",
-"\n",
-"# check if leaf node for this s\n",
-"if counter == s:\n",
-"sum_leaf_n_i += n_i\n",
-"counter += 1\n",
-"\n",
-"#val_losses = [ 
run_then_return_val_loss(num_iters=r_i,hyperparameters=t) for t in T ]\n",
-"#T = [ T[i] for i in argsort(val_losses)[0:int( n_i/eta )] ]\n",
-" End Finite Horizon Successive Halving with (n,r)\n",
-"\n",
-"print (\" \")\n",
-"print (\"sum of configurations at leaf nodes across all s = \" + 
str(sum_leaf_n_i))\n",
-   

[madlib] branch master updated: LDA: Turn off create table notices

2019-11-21 Thread nkak
This is an automated email from the ASF dual-hosted git repository.

nkak 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 d68e355  LDA: Turn off create table notices
d68e355 is described below

commit d68e355d011a492289fd9939d5d61964d9662089
Author: Nikhil Kak 
AuthorDate: Mon Nov 18 15:45:07 2019 -0800

LDA: Turn off create table notices

JIRA: MADLIB-1395

Set client_min_messages to 'error' for all lda related functions to
silence any postgres notice messages.
---
 src/ports/postgres/modules/lda/lda.sql_in | 15 ++-
 .../postgres/modules/utilities/text_utilities.sql_in  |  3 ++-
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/ports/postgres/modules/lda/lda.sql_in 
b/src/ports/postgres/modules/lda/lda.sql_in
index 36e8106..814b0ae 100644
--- a/src/ports/postgres/modules/lda/lda.sql_in
+++ b/src/ports/postgres/modules/lda/lda.sql_in
@@ -1056,7 +1056,8 @@ MADLIB_SCHEMA.lda_train
 )
 RETURNS SETOF MADLIB_SCHEMA.lda_result AS $$
 PythonFunctionBodyOnly(`lda', `lda')
-with AOControl(False):
+from utilities.control import MinWarning
+with AOControl(False) and MinWarning("error"):
 lda.lda_train(schema_madlib, data_table, model_table, 
output_data_table,
   voc_size, topic_num, iter_num, alpha, beta, None, None)
 return [[model_table, 'model table'],
@@ -1133,7 +1134,8 @@ MADLIB_SCHEMA.lda_predict
 )
 RETURNS SETOF MADLIB_SCHEMA.lda_result AS $$
 PythonFunctionBodyOnly(`lda', `lda')
-with AOControl(False):
+from utilities.control import MinWarning
+with AOControl(False) and MinWarning("error"):
 lda.lda_predict(schema_madlib, data_table, model_table, output_table)
 return [[
 output_table,
@@ -1194,7 +1196,8 @@ MADLIB_SCHEMA.lda_get_word_topic_count
 )
 RETURNS SETOF MADLIB_SCHEMA.lda_result AS $$
 PythonFunctionBodyOnly(`lda', `lda')
-with AOControl(False):
+from utilities.control import MinWarning
+with AOControl(False) and MinWarning("error"):
 lda.get_word_topic_count(schema_madlib, model_table, output_table)
 return [[output_table, 'per-word topic counts']]
 $$ LANGUAGE plpythonu STRICT
@@ -1217,7 +1220,8 @@ MADLIB_SCHEMA.lda_get_topic_desc
 )
 RETURNS SETOF MADLIB_SCHEMA.lda_result AS $$
 PythonFunctionBodyOnly(`lda', `lda')
-with AOControl(False):
+from utilities.control import MinWarning
+with AOControl(False) and MinWarning("error"):
 lda.get_topic_desc(schema_madlib, model_table, vocab_table, 
desc_table, top_k)
 return [[
 desc_table,
@@ -1239,7 +1243,8 @@ MADLIB_SCHEMA.lda_get_word_topic_mapping
 )
 RETURNS SETOF MADLIB_SCHEMA.lda_result AS $$
 PythonFunctionBodyOnly(`lda', `lda')
-with AOControl(False):
+from utilities.control import MinWarning
+with AOControl(False) and MinWarning("error"):
 lda.get_word_topic_mapping(schema_madlib, lda_output_table, 
mapping_table)
 return [[mapping_table, 'wordid - topicid mapping']]
 $$ LANGUAGE plpythonu STRICT
diff --git a/src/ports/postgres/modules/utilities/text_utilities.sql_in 
b/src/ports/postgres/modules/utilities/text_utilities.sql_in
index 2438239..478e751 100644
--- a/src/ports/postgres/modules/utilities/text_utilities.sql_in
+++ b/src/ports/postgres/modules/utilities/text_utilities.sql_in
@@ -324,7 +324,8 @@ CREATE OR REPLACE FUNCTION MADLIB_SCHEMA.term_frequency(
 RETURNS TEXT
 AS $$
 PythonFunctionBodyOnly(`utilities', `text_utilities')
-with AOControl(False):
+from utilities.control import MinWarning
+with AOControl(False) and MinWarning("error"):
 return text_utilities.term_frequency(input_table, doc_id_col, 
word_vec_col,
  output_table, 
compute_vocab=compute_vocab)
 $$