ThomasDelteil commented on a change in pull request #12918: Update adversary
attack generation example
URL: https://github.com/apache/incubator-mxnet/pull/12918#discussion_r227978104
##########
File path: example/adversary/adversary_generation.ipynb
##########
@@ -28,290 +27,312 @@
"import matplotlib.pyplot as plt\n",
"import matplotlib.cm as cm\n",
"\n",
- "from mxnet.test_utils import get_mnist_iterator"
+ "from mxnet import gluon"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "Build Network\n",
- "\n",
- "note: in this network, we will calculate softmax, gradient in numpy"
+ "Build simple CNN network for solving the MNIST dataset digit recognition
task"
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 17,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
- "dev = mx.cpu()\n",
- "batch_size = 100\n",
- "train_iter, val_iter = get_mnist_iterator(batch_size=batch_size,
input_shape = (1,28,28))"
+ "ctx = mx.gpu() if len(mx.test_utils.list_gpus()) else mx.cpu()\n",
Review comment:
Fixed the utils, this error should be caught and range(0,0) should be
returned.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services