You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@madlib.apache.org by ri...@apache.org on 2018/04/13 17:41:50 UTC
madlib git commit: MLP: Restrict client_min_warning to error
Repository: madlib
Updated Branches:
refs/heads/master 0f78d5a27 -> b2efa7d0b
MLP: Restrict client_min_warning to error
- Added a MinWarning("error") decorator for MLP
- Inheriting OptimizerControl and HashaggControl from ContextDecorator
to use them as decorators and context managers.
Project: http://git-wip-us.apache.org/repos/asf/madlib/repo
Commit: http://git-wip-us.apache.org/repos/asf/madlib/commit/b2efa7d0
Tree: http://git-wip-us.apache.org/repos/asf/madlib/tree/b2efa7d0
Diff: http://git-wip-us.apache.org/repos/asf/madlib/diff/b2efa7d0
Branch: refs/heads/master
Commit: b2efa7d0b597a59f8edffb2ec53f6a2bedb076d2
Parents: 0f78d5a
Author: Rahul Iyer <ri...@apache.org>
Authored: Fri Apr 13 10:39:18 2018 -0700
Committer: Rahul Iyer <ri...@apache.org>
Committed: Fri Apr 13 10:39:18 2018 -0700
----------------------------------------------------------------------
src/ports/postgres/modules/convex/mlp_igd.py_in | 3 +++
src/ports/postgres/modules/utilities/control.py_in | 5 ++---
2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/madlib/blob/b2efa7d0/src/ports/postgres/modules/convex/mlp_igd.py_in
----------------------------------------------------------------------
diff --git a/src/ports/postgres/modules/convex/mlp_igd.py_in b/src/ports/postgres/modules/convex/mlp_igd.py_in
index 6ff3d86..c37cf96 100644
--- a/src/ports/postgres/modules/convex/mlp_igd.py_in
+++ b/src/ports/postgres/modules/convex/mlp_igd.py_in
@@ -32,6 +32,7 @@ from convex.utils_regularization import utils_ind_var_scales_grouping
from convex.utils_regularization import __utils_normalize_data
from convex.utils_regularization import __utils_normalize_data_grouping
+from utilities.control import MinWarning
from utilities.in_mem_group_control import GroupIterationController
from utilities.utilities import _array_to_string
from utilities.utilities import _assert
@@ -54,6 +55,8 @@ from utilities.validate_args import output_tbl_valid
from utilities.validate_args import table_exists
from utilities.minibatch_validation import is_var_one_hot_encoded_for_minibatch
+
+@MinWarning("error")
def mlp(schema_madlib, source_table, output_table, independent_varname,
dependent_varname, hidden_layer_sizes, optimizer_param_str, activation,
is_classification, weights, warm_start, verbose=False, grouping_col=""):
http://git-wip-us.apache.org/repos/asf/madlib/blob/b2efa7d0/src/ports/postgres/modules/utilities/control.py_in
----------------------------------------------------------------------
diff --git a/src/ports/postgres/modules/utilities/control.py_in b/src/ports/postgres/modules/utilities/control.py_in
index 2e0da0d..5861fa2 100644
--- a/src/ports/postgres/modules/utilities/control.py_in
+++ b/src/ports/postgres/modules/utilities/control.py_in
@@ -47,8 +47,7 @@ class ContextDecorator(object):
return wrapper
-class OptimizerControl(object):
-
+class OptimizerControl(ContextDecorator):
"""
@brief: A wrapper that enables/disables the optimizer and
then sets it back to the original value on exit
@@ -99,7 +98,7 @@ class OptimizerControl(object):
format(('off', 'on')[self.optimizer_enabled]))
-class HashaggControl(object):
+class HashaggControl(ContextDecorator):
"""
@brief: A wrapper that enables/disables the hashagg and then sets it back