This is an automated email from the ASF dual-hosted git repository.
zhasheng 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 b5648a4 rename (#8056)
b5648a4 is described below
commit b5648a43955f7d05c0e53c1ab61a58bd402b4416
Author: Sheng Zha <[email protected]>
AuthorDate: Wed Sep 27 16:39:42 2017 -0700
rename (#8056)
* rename
* Update ndarray_softmax.py
---
example/adversary/adversary_generation.ipynb | 2 +-
example/gluon/tree_lstm/dataset.cPickle | Bin 0 -> 17896237 bytes
example/multi-task/example_multi_task.py | 4 +--
example/numpy-ops/custom_softmax.py | 4 +--
example/numpy-ops/ndarray_softmax.py | 4 +--
example/numpy-ops/numpy_softmax.py | 4 +--
example/python-howto/data.py | 49 ---------------------------
example/python-howto/monitor_weights.py | 8 +++--
example/torch/data.py | 49 ---------------------------
example/torch/torch_module.py | 8 +++--
tests/python/common/get_data.py | 2 +-
11 files changed, 22 insertions(+), 112 deletions(-)
diff --git a/example/adversary/adversary_generation.ipynb
b/example/adversary/adversary_generation.ipynb
index a545187..8adae3d 100644
--- a/example/adversary/adversary_generation.ipynb
+++ b/example/adversary/adversary_generation.ipynb
@@ -31,7 +31,7 @@
"import os\n",
"import sys\n",
"sys.path.append(os.path.join(os.getcwd(),
\"../../tests/python/common\"))\n",
- "from get_data import mnist_iterator"
+ "from get_data import MNISTIterator"
]
},
{
diff --git a/example/gluon/tree_lstm/dataset.cPickle
b/example/gluon/tree_lstm/dataset.cPickle
new file mode 100644
index 0000000..bdfca53
Binary files /dev/null and b/example/gluon/tree_lstm/dataset.cPickle differ
diff --git a/example/multi-task/example_multi_task.py
b/example/multi-task/example_multi_task.py
index 5a42516..ec5ece9 100644
--- a/example/multi-task/example_multi_task.py
+++ b/example/multi-task/example_multi_task.py
@@ -21,7 +21,7 @@ import os
sys.path.insert(0, "../../python/")
curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
sys.path.append(os.path.join(curr_path, "../../tests/python/common"))
-from get_data import mnist_iterator
+from get_data import MNISTIterator
import mxnet as mx
import numpy as np
import logging
@@ -143,7 +143,7 @@ device = mx.gpu(0)
lr = 0.01
network = build_network()
-train, val = mnist_iterator(batch_size=batch_size, input_shape = (784,))
+train, val = MNISTIterator(batch_size=batch_size, input_shape = (784,))
train = Multi_mnist_iterator(train)
val = Multi_mnist_iterator(val)
diff --git a/example/numpy-ops/custom_softmax.py
b/example/numpy-ops/custom_softmax.py
index cbfcdfa..82f491e 100644
--- a/example/numpy-ops/custom_softmax.py
+++ b/example/numpy-ops/custom_softmax.py
@@ -20,7 +20,7 @@ import sys
import os
curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
sys.path.append(os.path.join(curr_path, "../../tests/python/common"))
-from get_data import mnist_iterator
+from get_data import MNISTIterator
import mxnet as mx
import numpy as np
import logging
@@ -75,7 +75,7 @@ mlp = mx.symbol.Custom(data=fc3, name='softmax',
op_type='softmax')
# data
-train, val = mnist_iterator(batch_size=100, input_shape = (784,))
+train, val = MNISTIterator(batch_size=100, input_shape = (784,))
# train
diff --git a/example/numpy-ops/ndarray_softmax.py
b/example/numpy-ops/ndarray_softmax.py
index ed60e8e..4ced2c5 100644
--- a/example/numpy-ops/ndarray_softmax.py
+++ b/example/numpy-ops/ndarray_softmax.py
@@ -20,7 +20,7 @@ import os
import sys
curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
sys.path.append(os.path.join(curr_path, "../../tests/python/common"))
-from get_data import mnist_iterator
+from get_data import MNISTIterator
import mxnet as mx
import numpy as np
import logging
@@ -97,7 +97,7 @@ mlp = mysoftmax(data=fc3, name = 'softmax')
# data
-train, val = mnist_iterator(batch_size=100, input_shape = (784,))
+train, val = MNISTIterator(batch_size=100, input_shape = (784,))
# train
diff --git a/example/numpy-ops/numpy_softmax.py
b/example/numpy-ops/numpy_softmax.py
index 1650fe4..cbcb778 100644
--- a/example/numpy-ops/numpy_softmax.py
+++ b/example/numpy-ops/numpy_softmax.py
@@ -20,7 +20,7 @@ import sys
import os
curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
sys.path.append(os.path.join(curr_path, "../../tests/python/common"))
-from get_data import mnist_iterator
+from get_data import MNISTIterator
import mxnet as mx
import numpy as np
import logging
@@ -70,7 +70,7 @@ mlp = mysoftmax(data=fc3, name = 'softmax')
# data
-train, val = mnist_iterator(batch_size=100, input_shape = (784,))
+train, val = MNISTIterator(batch_size=100, input_shape = (784,))
# train
diff --git a/example/python-howto/data.py b/example/python-howto/data.py
deleted file mode 100644
index 0ca8e1f..0000000
--- a/example/python-howto/data.py
+++ /dev/null
@@ -1,49 +0,0 @@
-# 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.
-
-# pylint: skip-file
-""" data iterator for mnist """
-import sys
-import os
-# code to automatically download dataset
-curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
-sys.path.append(os.path.join(curr_path, "../../tests/python/common"))
-import get_data
-import mxnet as mx
-
-def mnist_iterator(batch_size, input_shape):
- """return train and val iterators for mnist"""
- # download data
- get_data.GetMNIST_ubyte()
- flat = False if len(input_shape) == 3 else True
-
- train_dataiter = mx.io.MNISTIter(
- image="data/train-images-idx3-ubyte",
- label="data/train-labels-idx1-ubyte",
- input_shape=input_shape,
- batch_size=batch_size,
- shuffle=True,
- flat=flat)
-
- val_dataiter = mx.io.MNISTIter(
- image="data/t10k-images-idx3-ubyte",
- label="data/t10k-labels-idx1-ubyte",
- input_shape=input_shape,
- batch_size=batch_size,
- flat=flat)
-
- return (train_dataiter, val_dataiter)
diff --git a/example/python-howto/monitor_weights.py
b/example/python-howto/monitor_weights.py
index c54e649..a8b2551 100644
--- a/example/python-howto/monitor_weights.py
+++ b/example/python-howto/monitor_weights.py
@@ -16,7 +16,11 @@
# under the License.
# pylint: skip-file
-from data import mnist_iterator
+import sys
+import os
+curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
+sys.path.append(os.path.join(curr_path, "../../tests/python/common"))
+from get_data import MNISTIterator
import mxnet as mx
import numpy as np
import logging
@@ -31,7 +35,7 @@ mlp = mx.symbol.SoftmaxOutput(data = fc3, name = 'softmax')
# data
-train, val = mnist_iterator(batch_size=100, input_shape = (784,))
+train, val = MNISTIterator(batch_size=100, input_shape = (784,))
# train
diff --git a/example/torch/data.py b/example/torch/data.py
deleted file mode 100644
index 0ca8e1f..0000000
--- a/example/torch/data.py
+++ /dev/null
@@ -1,49 +0,0 @@
-# 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.
-
-# pylint: skip-file
-""" data iterator for mnist """
-import sys
-import os
-# code to automatically download dataset
-curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
-sys.path.append(os.path.join(curr_path, "../../tests/python/common"))
-import get_data
-import mxnet as mx
-
-def mnist_iterator(batch_size, input_shape):
- """return train and val iterators for mnist"""
- # download data
- get_data.GetMNIST_ubyte()
- flat = False if len(input_shape) == 3 else True
-
- train_dataiter = mx.io.MNISTIter(
- image="data/train-images-idx3-ubyte",
- label="data/train-labels-idx1-ubyte",
- input_shape=input_shape,
- batch_size=batch_size,
- shuffle=True,
- flat=flat)
-
- val_dataiter = mx.io.MNISTIter(
- image="data/t10k-images-idx3-ubyte",
- label="data/t10k-labels-idx1-ubyte",
- input_shape=input_shape,
- batch_size=batch_size,
- flat=flat)
-
- return (train_dataiter, val_dataiter)
diff --git a/example/torch/torch_module.py b/example/torch/torch_module.py
index 1595173..e2f7821 100644
--- a/example/torch/torch_module.py
+++ b/example/torch/torch_module.py
@@ -16,7 +16,11 @@
# under the License.
# pylint: skip-file
-from data import mnist_iterator
+import sys
+import os
+curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
+sys.path.append(os.path.join(curr_path, "../../tests/python/common"))
+from get_data import MNISTIterator
import mxnet as mx
import numpy as np
import logging
@@ -42,7 +46,7 @@ else:
# data
-train, val = mnist_iterator(batch_size=100, input_shape = (784,))
+train, val = MNISTIterator(batch_size=100, input_shape = (784,))
# train
diff --git a/tests/python/common/get_data.py b/tests/python/common/get_data.py
index 3cd39a1..5802a06 100644
--- a/tests/python/common/get_data.py
+++ b/tests/python/common/get_data.py
@@ -57,7 +57,7 @@ def GetCifar10():
with zipfile.ZipFile(zip_file_path) as zf:
zf.extractall('data')
-def mnist_iterator(batch_size, input_shape):
+def MNISTIterator(batch_size, input_shape):
"""return train and val iterators for mnist"""
# download data
GetMNIST_ubyte()
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].