You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by tq...@apache.org on 2017/10/27 19:19:08 UTC
[incubator-mxnet] branch master updated: [CMAKE] Cmake changes,
upgrade training test so it converge (#8343)
This is an automated email from the ASF dual-hosted git repository.
tqchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
The following commit(s) were added to refs/heads/master by this push:
new d6f6416 [CMAKE] Cmake changes, upgrade training test so it converge (#8343)
d6f6416 is described below
commit d6f6416e7e27d4981431c94f58359eebd6f79eea
Author: Tianqi Chen <tq...@users.noreply.github.com>
AuthorDate: Fri Oct 27 14:18:59 2017 -0500
[CMAKE] Cmake changes, upgrade training test so it converge (#8343)
---
CMakeLists.txt | 10 +++++--
cpp-package/scripts/OpWrapperGenerator.py | 11 +++++---
nnvm | 2 +-
python/mxnet/visualization.py | 44 +++++++++++++++----------------
tests/python/train/test_dtype.py | 1 -
5 files changed, 38 insertions(+), 30 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 76ef5af..63bc8d7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -275,7 +275,14 @@ FILE(GLOB_RECURSE SOURCE "src/*.cc" "src/*.h" "include/*.h")
FILE(GLOB_RECURSE CUDA "src/*.cu" "src/*.cuh")
# add nnvm to source
-FILE(GLOB_RECURSE NNVMSOURCE "nnvm/src/*.cc" "nnvm/src/*.h" "nnvm/include/*.h")
+FILE(GLOB_RECURSE NNVMSOURCE
+ nnvm/src/c_api/*.cc
+ nnvm/src/core/*.cc
+ nnvm/src/pass/*.cc
+ nnvm/src/c_api/*.h
+ nnvm/src/core/*.h
+ nnvm/src/pass/*.h
+ nnvm/include/*.h)
list(APPEND SOURCE ${NNVMSOURCE})
# add mshadow file
@@ -527,4 +534,3 @@ if(MSVC)
endif()
set(LINT_DIRS include src scripts python tests cpp-package)
add_custom_target(mxnet_lint COMMAND ${CMAKE_COMMAND} -DMSVC=${MSVC} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -DLINT_DIRS=${LINT_DIRS} -DPROJECT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DPROJECT_NAME=mxnet -P ${CMAKE_CURRENT_SOURCE_DIR}/dmlc-core/cmake/lint.cmake)
-
diff --git a/cpp-package/scripts/OpWrapperGenerator.py b/cpp-package/scripts/OpWrapperGenerator.py
index 83495fe..ac95773 100644
--- a/cpp-package/scripts/OpWrapperGenerator.py
+++ b/cpp-package/scripts/OpWrapperGenerator.py
@@ -124,12 +124,15 @@ class Arg:
self.defaultString = self.enum.GetDefaultValueString(self.defaultString)
elif self.defaultString == 'None':
self.defaultString = self.type + '()'
- elif self.defaultString == 'False':
- self.defaultString = 'false'
- elif self.defaultString == 'True':
- self.defaultString = 'true'
+ elif self.type == "bool":
+ if self.defaultString == "1" or self.defaultString == "True":
+ self.defaultString = "true"
+ else:
+ self.defaultString = "false"
elif self.defaultString[0] == '(':
self.defaultString = 'Shape' + self.defaultString
+ elif self.defaultString[0] == '[':
+ self.defaultString = 'Shape(' + self.defaultString[1:-1] + ")"
elif self.type == 'dmlc::optional<int>':
self.defaultString = self.type + '(' + self.defaultString + ')'
elif typeString.startswith('caffe-layer-parameter'):
diff --git a/nnvm b/nnvm
index c86afa8..8d79cfd 160000
--- a/nnvm
+++ b/nnvm
@@ -1 +1 @@
-Subproject commit c86afa8f17a44bcd4e6eec41cd49ba87e4f7a635
+Subproject commit 8d79cfd0b42fbe9f6ad75886d495065d5500b9dd
diff --git a/python/mxnet/visualization.py b/python/mxnet/visualization.py
index aa00488..8c4cc3b 100644
--- a/python/mxnet/visualization.py
+++ b/python/mxnet/visualization.py
@@ -134,20 +134,20 @@ def print_summary(symbol, shape=None, line_length=120, positions=[.44, .64, .74,
pre_filter = pre_filter + int(shape[0])
cur_param = 0
if op == 'Convolution':
- if ("no_bias" in node["attr"]) and (node["attr"]["no_bias"] == 'True'):
- cur_param = pre_filter * int(node["attr"]["num_filter"])
- for k in _str2tuple(node["attr"]["kernel"]):
+ if ("no_bias" in node["attrs"]) and int(node["attrs"]["no_bias"]):
+ cur_param = pre_filter * int(node["attrs"]["num_filter"])
+ for k in _str2tuple(node["attrs"]["kernel"]):
cur_param *= int(k)
else:
- cur_param = pre_filter * int(node["attr"]["num_filter"])
- for k in _str2tuple(node["attr"]["kernel"]):
+ cur_param = pre_filter * int(node["attrs"]["num_filter"])
+ for k in _str2tuple(node["attrs"]["kernel"]):
cur_param *= int(k)
- cur_param += int(node["attr"]["num_filter"])
+ cur_param += int(node["attrs"]["num_filter"])
elif op == 'FullyConnected':
- if ("no_bias" in node["attr"]) and (node["attr"]["no_bias"] == 'True'):
- cur_param = pre_filter * (int(node["attr"]["num_hidden"]))
+ if ("no_bias" in node["attrs"]) and int(node["attrs"]["no_bias"]):
+ cur_param = pre_filter * (int(node["attrs"]["num_hidden"]))
else:
- cur_param = (pre_filter+1) * (int(node["attr"]["num_hidden"]))
+ cur_param = (pre_filter+1) * (int(node["attrs"]["num_hidden"]))
elif op == 'BatchNorm':
key = node["name"] + "_output"
if show_shape:
@@ -291,24 +291,24 @@ def plot_network(symbol, title="plot", save_format='pdf', shape=None, node_attrs
label = node["name"]
attr["fillcolor"] = cm[0]
elif op == "Convolution":
- label = r"Convolution\n%s/%s, %s" % ("x".join(_str2tuple(node["attr"]["kernel"])),
- "x".join(_str2tuple(node["attr"]["stride"]))
- if "stride" in node["attr"] else "1",
- node["attr"]["num_filter"])
+ label = r"Convolution\n%s/%s, %s" % ("x".join(_str2tuple(node["attrs"]["kernel"])),
+ "x".join(_str2tuple(node["attrs"]["stride"]))
+ if "stride" in node["attrs"] else "1",
+ node["attrs"]["num_filter"])
attr["fillcolor"] = cm[1]
elif op == "FullyConnected":
- label = r"FullyConnected\n%s" % node["attr"]["num_hidden"]
+ label = r"FullyConnected\n%s" % node["attrs"]["num_hidden"]
attr["fillcolor"] = cm[1]
elif op == "BatchNorm":
attr["fillcolor"] = cm[3]
elif op == "Activation" or op == "LeakyReLU":
- label = r"%s\n%s" % (op, node["attr"]["act_type"])
+ label = r"%s\n%s" % (op, node["attrs"]["act_type"])
attr["fillcolor"] = cm[2]
elif op == "Pooling":
- label = r"Pooling\n%s, %s/%s" % (node["attr"]["pool_type"],
- "x".join(_str2tuple(node["attr"]["kernel"])),
- "x".join(_str2tuple(node["attr"]["stride"]))
- if "stride" in node["attr"] else "1")
+ label = r"Pooling\n%s, %s/%s" % (node["attrs"]["pool_type"],
+ "x".join(_str2tuple(node["attrs"]["kernel"])),
+ "x".join(_str2tuple(node["attrs"]["stride"]))
+ if "stride" in node["attrs"] else "1")
attr["fillcolor"] = cm[4]
elif op == "Concat" or op == "Flatten" or op == "Reshape":
attr["fillcolor"] = cm[5]
@@ -317,7 +317,7 @@ def plot_network(symbol, title="plot", save_format='pdf', shape=None, node_attrs
else:
attr["fillcolor"] = cm[7]
if op == "Custom":
- label = node["attr"]["op_type"]
+ label = node["attrs"]["op_type"]
dot.node(name=name, label=label, **attr)
@@ -338,8 +338,8 @@ def plot_network(symbol, title="plot", save_format='pdf', shape=None, node_attrs
if draw_shape:
if input_node["op"] != "null":
key = input_name + "_output"
- if "attr" in input_node:
- params = input_node["attr"]
+ if "attrs" in input_node:
+ params = input_node["attrs"]
if "num_outputs" in params:
key += str(int(params["num_outputs"]) - 1)
shape = shape_dict[key][1:]
diff --git a/tests/python/train/test_dtype.py b/tests/python/train/test_dtype.py
index 96912c0..52f04bf 100644
--- a/tests/python/train/test_dtype.py
+++ b/tests/python/train/test_dtype.py
@@ -175,7 +175,6 @@ def test_cifar10():
console = logging.StreamHandler()
console.setLevel(logging.DEBUG)
logging.getLogger('').addHandler(console)
-
kv = mx.kvstore.create("local")
# test float32 input
(train, val) = get_iterator_float32(kv)
--
To stop receiving notification emails like this one, please contact
['"commits@mxnet.apache.org" <co...@mxnet.apache.org>'].