From 4cfb9e1164ee1fed66c745503e202b3b2a156339 Mon Sep 17 00:00:00 2001 From: r3stl355 Date: Wed, 2 Sep 2020 18:13:08 +0100 Subject: [PATCH] Fix MNIST classification example (#19072) Co-authored-by: r3stl355 --- CONTRIBUTORS.md | 1 + example/gluon/mnist/README.md | 7 +++---- example/gluon/mnist/mnist.py | 7 +++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 3bf9ece78963..756f1b6f3f43 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -284,6 +284,7 @@ List of Contributors * [Connor Goggins](https://github.com/connorgoggins) * [Wei Chu](https://github.com/waytrue17) * [Joe Evans](https://github.com/josephevans) +* [Nikolay Ulmasov](https://github.com/r3stl355) Label Bot --------- diff --git a/example/gluon/mnist/README.md b/example/gluon/mnist/README.md index c053364fad3c..5e0c17f796a2 100644 --- a/example/gluon/mnist/README.md +++ b/example/gluon/mnist/README.md @@ -21,10 +21,9 @@ This script shows a simple example how to do image classification with Gluon. The model is trained on MNIST digits image dataset and the goal is to classify the digits ```0-9```. The model has the following layout: ``` net = nn.Sequential() -with net.name_scope(): - net.add(nn.Dense(128, activation='relu')) - net.add(nn.Dense(64, activation='relu')) - net.add(nn.Dense(10)) +net.add(nn.Dense(128, activation='relu')) +net.add(nn.Dense(64, activation='relu')) +net.add(nn.Dense(10)) ``` The script provides the following commandline arguments: diff --git a/example/gluon/mnist/mnist.py b/example/gluon/mnist/mnist.py index 81259db8b939..8066379df05a 100644 --- a/example/gluon/mnist/mnist.py +++ b/example/gluon/mnist/mnist.py @@ -48,10 +48,9 @@ # define network net = nn.Sequential() -with net.name_scope(): - net.add(nn.Dense(128, activation='relu')) - net.add(nn.Dense(64, activation='relu')) - net.add(nn.Dense(10)) +net.add(nn.Dense(128, activation='relu')) +net.add(nn.Dense(64, activation='relu')) +net.add(nn.Dense(10)) # data