{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "First of all, import all needed packages, particularly: **torch** and **torchvision**." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "# Original Source: https://github.com/pytorch/examples/blob/master/mnist/main.py\n", "# Code from: https://github.com/jiapei100/PyTorchZeroToAll/blob/master/10_1_cnn_mnist.py\n", "\n", "from __future__ import print_function\n", "import argparse\n", "import torch\n", "import torch.nn as nn\n", "import torch.nn.functional as F\n", "import torch.optim as optim\n", "from torchvision import datasets, transforms\n", "from torch.autograd import Variable" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Loading MNIST dataset. You'll see 4 datasets are downloaded during the running process.\n", "* Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz\n", "* Downloading http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz\n", "* Downloading http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz\n", "* Downloading http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz\n" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "\n", "# Training settings\n", "batch_size = 64\n", "\n", "# MNIST Dataset\n", "train_dataset = datasets.MNIST(root='./data/',\n", " train=True,\n", " transform=transforms.ToTensor(),\n", " download=True)\n", "\n", "test_dataset = datasets.MNIST(root='./data/',\n", " train=False,\n", " transform=transforms.ToTensor())\n", "\n", "# Data Loader (Input Pipeline)\n", "train_loader = torch.utils.data.DataLoader(dataset=train_dataset,\n", " batch_size=batch_size,\n", " shuffle=True)\n", "\n", "test_loader = torch.utils.data.DataLoader(dataset=test_dataset,\n", " batch_size=batch_size,\n", " shuffle=False)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Afterwards, define CNN\n" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "\n", "class Net(nn.Module):\n", "\n", " def __init__(self):\n", " super(Net, self).__init__()\n", " self.conv1 = nn.Conv2d(1, 10, kernel_size=5)\n", " self.conv2 = nn.Conv2d(10, 20, kernel_size=5)\n", " self.mp = nn.MaxPool2d(2)\n", " self.fc = nn.Linear(320, 10)\n", "\n", " def forward(self, x):\n", " in_size = x.size(0)\n", " x = F.relu(self.mp(self.conv1(x)))\n", " x = F.relu(self.mp(self.conv2(x)))\n", " x = x.view(in_size, -1) # flatten the tensor\n", " x = self.fc(x)\n", " return F.log_softmax(x, dim=1)\n", "\n", "\n", "model = Net()\n", "\n", "optimizer = optim.SGD(model.parameters(), lr=0.01, momentum=0.5)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Define training function" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "\n", "def train(epoch):\n", " model.train()\n", " for batch_idx, (data, target) in enumerate(train_loader):\n", " data, target = Variable(data), Variable(target)\n", " optimizer.zero_grad()\n", " output = model(data)\n", " loss = F.nll_loss(output, target)\n", " loss.backward()\n", " optimizer.step()\n", " if batch_idx % 10 == 0:\n", " print('Train Epoch: {} [{}/{} ({:.0f}%)]\\tLoss: {:.6f}'.format(\n", " epoch, batch_idx * len(data), len(train_loader.dataset),\n", " 100. * batch_idx / len(train_loader), loss.item()))\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Define testing function" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "\n", "def test():\n", " model.eval()\n", " test_loss = 0\n", " correct = 0\n", " for data, target in test_loader:\n", " data, target = Variable(data, requires_grad=True), Variable(target)\n", " with torch.no_grad():\n", " output = model(data)\n", " # sum up batch loss\n", " test_loss += F.nll_loss(output, target, size_average=False).item()\n", " # get the index of the max log-probability\n", " pred = output.data.max(1, keepdim=True)[1]\n", " correct += pred.eq(target.data.view_as(pred)).cpu().sum()\n", "\n", " test_loss /= len(test_loader.dataset)\n", " print('\\nTest set: Average loss: {:.4f}, Accuracy: {}/{} ({:.0f}%)\\n'.format(\n", " test_loss, correct, len(test_loader.dataset),\n", " 100. * correct / len(test_loader.dataset)))\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Train and test" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Train Epoch: 1 [0/60000 (0%)]\tLoss: 2.302750\n", "Train Epoch: 1 [640/60000 (1%)]\tLoss: 2.294239\n", "Train Epoch: 1 [1280/60000 (2%)]\tLoss: 2.277666\n", "Train Epoch: 1 [1920/60000 (3%)]\tLoss: 2.275154\n", "Train Epoch: 1 [2560/60000 (4%)]\tLoss: 2.284332\n", "Train Epoch: 1 [3200/60000 (5%)]\tLoss: 2.237666\n", "Train Epoch: 1 [3840/60000 (6%)]\tLoss: 2.236258\n", "Train Epoch: 1 [4480/60000 (7%)]\tLoss: 2.176656\n", "Train Epoch: 1 [5120/60000 (9%)]\tLoss: 2.151426\n", "Train Epoch: 1 [5760/60000 (10%)]\tLoss: 2.097822\n", "Train Epoch: 1 [6400/60000 (11%)]\tLoss: 1.962065\n", "Train Epoch: 1 [7040/60000 (12%)]\tLoss: 1.853730\n", "Train Epoch: 1 [7680/60000 (13%)]\tLoss: 1.654715\n", "Train Epoch: 1 [8320/60000 (14%)]\tLoss: 1.282262\n", "Train Epoch: 1 [8960/60000 (15%)]\tLoss: 1.057662\n", "Train Epoch: 1 [9600/60000 (16%)]\tLoss: 0.985463\n", "Train Epoch: 1 [10240/60000 (17%)]\tLoss: 0.880024\n", "Train Epoch: 1 [10880/60000 (18%)]\tLoss: 0.574015\n", "Train Epoch: 1 [11520/60000 (19%)]\tLoss: 0.623674\n", "Train Epoch: 1 [12160/60000 (20%)]\tLoss: 0.607889\n", "Train Epoch: 1 [12800/60000 (21%)]\tLoss: 0.657456\n", "Train Epoch: 1 [13440/60000 (22%)]\tLoss: 0.406524\n", "Train Epoch: 1 [14080/60000 (23%)]\tLoss: 0.560448\n", "Train Epoch: 1 [14720/60000 (25%)]\tLoss: 0.602153\n", "Train Epoch: 1 [15360/60000 (26%)]\tLoss: 0.521870\n", "Train Epoch: 1 [16000/60000 (27%)]\tLoss: 0.355486\n", "Train Epoch: 1 [16640/60000 (28%)]\tLoss: 0.467051\n", "Train Epoch: 1 [17280/60000 (29%)]\tLoss: 0.689880\n", "Train Epoch: 1 [17920/60000 (30%)]\tLoss: 0.477837\n", "Train Epoch: 1 [18560/60000 (31%)]\tLoss: 0.421290\n", "Train Epoch: 1 [19200/60000 (32%)]\tLoss: 0.328729\n", "Train Epoch: 1 [19840/60000 (33%)]\tLoss: 0.279361\n", "Train Epoch: 1 [20480/60000 (34%)]\tLoss: 0.440283\n", "Train Epoch: 1 [21120/60000 (35%)]\tLoss: 0.647068\n", "Train Epoch: 1 [21760/60000 (36%)]\tLoss: 0.340216\n", "Train Epoch: 1 [22400/60000 (37%)]\tLoss: 0.185844\n", "Train Epoch: 1 [23040/60000 (38%)]\tLoss: 0.370772\n", "Train Epoch: 1 [23680/60000 (39%)]\tLoss: 0.604638\n", "Train Epoch: 1 [24320/60000 (41%)]\tLoss: 0.289473\n", "Train Epoch: 1 [24960/60000 (42%)]\tLoss: 0.371890\n", "Train Epoch: 1 [25600/60000 (43%)]\tLoss: 0.338951\n", "Train Epoch: 1 [26240/60000 (44%)]\tLoss: 0.377979\n", "Train Epoch: 1 [26880/60000 (45%)]\tLoss: 0.475583\n", "Train Epoch: 1 [27520/60000 (46%)]\tLoss: 0.212702\n", "Train Epoch: 1 [28160/60000 (47%)]\tLoss: 0.234694\n", "Train Epoch: 1 [28800/60000 (48%)]\tLoss: 0.338335\n", "Train Epoch: 1 [29440/60000 (49%)]\tLoss: 0.403380\n", "Train Epoch: 1 [30080/60000 (50%)]\tLoss: 0.299236\n", "Train Epoch: 1 [30720/60000 (51%)]\tLoss: 0.371117\n", "Train Epoch: 1 [31360/60000 (52%)]\tLoss: 0.326608\n", "Train Epoch: 1 [32000/60000 (53%)]\tLoss: 0.362611\n", "Train Epoch: 1 [32640/60000 (54%)]\tLoss: 0.144903\n", "Train Epoch: 1 [33280/60000 (55%)]\tLoss: 0.354083\n", "Train Epoch: 1 [33920/60000 (57%)]\tLoss: 0.296097\n", "Train Epoch: 1 [34560/60000 (58%)]\tLoss: 0.365376\n", "Train Epoch: 1 [35200/60000 (59%)]\tLoss: 0.324697\n", "Train Epoch: 1 [35840/60000 (60%)]\tLoss: 0.572151\n", "Train Epoch: 1 [36480/60000 (61%)]\tLoss: 0.236434\n", "Train Epoch: 1 [37120/60000 (62%)]\tLoss: 0.212732\n", "Train Epoch: 1 [37760/60000 (63%)]\tLoss: 0.383258\n", "Train Epoch: 1 [38400/60000 (64%)]\tLoss: 0.349251\n", "Train Epoch: 1 [39040/60000 (65%)]\tLoss: 0.387144\n", "Train Epoch: 1 [39680/60000 (66%)]\tLoss: 0.318350\n", "Train Epoch: 1 [40320/60000 (67%)]\tLoss: 0.404448\n", "Train Epoch: 1 [40960/60000 (68%)]\tLoss: 0.172462\n", "Train Epoch: 1 [41600/60000 (69%)]\tLoss: 0.264691\n", "Train Epoch: 1 [42240/60000 (70%)]\tLoss: 0.272144\n", "Train Epoch: 1 [42880/60000 (71%)]\tLoss: 0.195797\n", "Train Epoch: 1 [43520/60000 (72%)]\tLoss: 0.304537\n", "Train Epoch: 1 [44160/60000 (74%)]\tLoss: 0.282850\n", "Train Epoch: 1 [44800/60000 (75%)]\tLoss: 0.329202\n", "Train Epoch: 1 [45440/60000 (76%)]\tLoss: 0.310663\n", "Train Epoch: 1 [46080/60000 (77%)]\tLoss: 0.144039\n", "Train Epoch: 1 [46720/60000 (78%)]\tLoss: 0.276784\n", "Train Epoch: 1 [47360/60000 (79%)]\tLoss: 0.207992\n", "Train Epoch: 1 [48000/60000 (80%)]\tLoss: 0.283097\n", "Train Epoch: 1 [48640/60000 (81%)]\tLoss: 0.159823\n", "Train Epoch: 1 [49280/60000 (82%)]\tLoss: 0.356448\n", "Train Epoch: 1 [49920/60000 (83%)]\tLoss: 0.273224\n", "Train Epoch: 1 [50560/60000 (84%)]\tLoss: 0.134302\n", "Train Epoch: 1 [51200/60000 (85%)]\tLoss: 0.252466\n", "Train Epoch: 1 [51840/60000 (86%)]\tLoss: 0.296629\n", "Train Epoch: 1 [52480/60000 (87%)]\tLoss: 0.136439\n", "Train Epoch: 1 [53120/60000 (88%)]\tLoss: 0.226093\n", "Train Epoch: 1 [53760/60000 (90%)]\tLoss: 0.241420\n", "Train Epoch: 1 [54400/60000 (91%)]\tLoss: 0.308084\n", "Train Epoch: 1 [55040/60000 (92%)]\tLoss: 0.116024\n", "Train Epoch: 1 [55680/60000 (93%)]\tLoss: 0.215715\n", "Train Epoch: 1 [56320/60000 (94%)]\tLoss: 0.211644\n", "Train Epoch: 1 [56960/60000 (95%)]\tLoss: 0.217347\n", "Train Epoch: 1 [57600/60000 (96%)]\tLoss: 0.259077\n", "Train Epoch: 1 [58240/60000 (97%)]\tLoss: 0.241611\n", "Train Epoch: 1 [58880/60000 (98%)]\tLoss: 0.202261\n", "Train Epoch: 1 [59520/60000 (99%)]\tLoss: 0.084446\n", "\n", "Test set: Average loss: 0.1844, Accuracy: 9473/10000 (95%)\n", "\n", "Train Epoch: 2 [0/60000 (0%)]\tLoss: 0.335339\n", "Train Epoch: 2 [640/60000 (1%)]\tLoss: 0.101215\n", "Train Epoch: 2 [1280/60000 (2%)]\tLoss: 0.125136\n", "Train Epoch: 2 [1920/60000 (3%)]\tLoss: 0.205086\n", "Train Epoch: 2 [2560/60000 (4%)]\tLoss: 0.210856\n", "Train Epoch: 2 [3200/60000 (5%)]\tLoss: 0.213990\n", "Train Epoch: 2 [3840/60000 (6%)]\tLoss: 0.214273\n", "Train Epoch: 2 [4480/60000 (7%)]\tLoss: 0.393762\n", "Train Epoch: 2 [5120/60000 (9%)]\tLoss: 0.190642\n", "Train Epoch: 2 [5760/60000 (10%)]\tLoss: 0.099488\n", "Train Epoch: 2 [6400/60000 (11%)]\tLoss: 0.169744\n", "Train Epoch: 2 [7040/60000 (12%)]\tLoss: 0.203104\n", "Train Epoch: 2 [7680/60000 (13%)]\tLoss: 0.120816\n", "Train Epoch: 2 [8320/60000 (14%)]\tLoss: 0.150728\n", "Train Epoch: 2 [8960/60000 (15%)]\tLoss: 0.229119\n", "Train Epoch: 2 [9600/60000 (16%)]\tLoss: 0.091388\n", "Train Epoch: 2 [10240/60000 (17%)]\tLoss: 0.100694\n", "Train Epoch: 2 [10880/60000 (18%)]\tLoss: 0.222582\n", "Train Epoch: 2 [11520/60000 (19%)]\tLoss: 0.126701\n", "Train Epoch: 2 [12160/60000 (20%)]\tLoss: 0.297048\n", "Train Epoch: 2 [12800/60000 (21%)]\tLoss: 0.174746\n", "Train Epoch: 2 [13440/60000 (22%)]\tLoss: 0.451948\n", "Train Epoch: 2 [14080/60000 (23%)]\tLoss: 0.133486\n", "Train Epoch: 2 [14720/60000 (25%)]\tLoss: 0.291300\n", "Train Epoch: 2 [15360/60000 (26%)]\tLoss: 0.184698\n", "Train Epoch: 2 [16000/60000 (27%)]\tLoss: 0.110213\n", "Train Epoch: 2 [16640/60000 (28%)]\tLoss: 0.162748\n", "Train Epoch: 2 [17280/60000 (29%)]\tLoss: 0.143355\n", "Train Epoch: 2 [17920/60000 (30%)]\tLoss: 0.213226\n", "Train Epoch: 2 [18560/60000 (31%)]\tLoss: 0.132270\n", "Train Epoch: 2 [19200/60000 (32%)]\tLoss: 0.224205\n", "Train Epoch: 2 [19840/60000 (33%)]\tLoss: 0.115983\n", "Train Epoch: 2 [20480/60000 (34%)]\tLoss: 0.227553\n", "Train Epoch: 2 [21120/60000 (35%)]\tLoss: 0.169280\n", "Train Epoch: 2 [21760/60000 (36%)]\tLoss: 0.089836\n", "Train Epoch: 2 [22400/60000 (37%)]\tLoss: 0.140270\n", "Train Epoch: 2 [23040/60000 (38%)]\tLoss: 0.126178\n", "Train Epoch: 2 [23680/60000 (39%)]\tLoss: 0.157805\n", "Train Epoch: 2 [24320/60000 (41%)]\tLoss: 0.185493\n", "Train Epoch: 2 [24960/60000 (42%)]\tLoss: 0.380474\n", "Train Epoch: 2 [25600/60000 (43%)]\tLoss: 0.087696\n", "Train Epoch: 2 [26240/60000 (44%)]\tLoss: 0.053152\n", "Train Epoch: 2 [26880/60000 (45%)]\tLoss: 0.279660\n", "Train Epoch: 2 [27520/60000 (46%)]\tLoss: 0.070056\n", "Train Epoch: 2 [28160/60000 (47%)]\tLoss: 0.132298\n", "Train Epoch: 2 [28800/60000 (48%)]\tLoss: 0.107575\n", "Train Epoch: 2 [29440/60000 (49%)]\tLoss: 0.249032\n", "Train Epoch: 2 [30080/60000 (50%)]\tLoss: 0.117548\n", "Train Epoch: 2 [30720/60000 (51%)]\tLoss: 0.167482\n", "Train Epoch: 2 [31360/60000 (52%)]\tLoss: 0.179214\n", "Train Epoch: 2 [32000/60000 (53%)]\tLoss: 0.098969\n", "Train Epoch: 2 [32640/60000 (54%)]\tLoss: 0.182664\n", "Train Epoch: 2 [33280/60000 (55%)]\tLoss: 0.063118\n", "Train Epoch: 2 [33920/60000 (57%)]\tLoss: 0.123099\n", "Train Epoch: 2 [34560/60000 (58%)]\tLoss: 0.142745\n", "Train Epoch: 2 [35200/60000 (59%)]\tLoss: 0.096934\n", "Train Epoch: 2 [35840/60000 (60%)]\tLoss: 0.053674\n", "Train Epoch: 2 [36480/60000 (61%)]\tLoss: 0.147441\n", "Train Epoch: 2 [37120/60000 (62%)]\tLoss: 0.277926\n", "Train Epoch: 2 [37760/60000 (63%)]\tLoss: 0.246985\n", "Train Epoch: 2 [38400/60000 (64%)]\tLoss: 0.343751\n", "Train Epoch: 2 [39040/60000 (65%)]\tLoss: 0.083396\n", "Train Epoch: 2 [39680/60000 (66%)]\tLoss: 0.097020\n", "Train Epoch: 2 [40320/60000 (67%)]\tLoss: 0.374275\n", "Train Epoch: 2 [40960/60000 (68%)]\tLoss: 0.264117\n", "Train Epoch: 2 [41600/60000 (69%)]\tLoss: 0.096749\n", "Train Epoch: 2 [42240/60000 (70%)]\tLoss: 0.372819\n", "Train Epoch: 2 [42880/60000 (71%)]\tLoss: 0.314999\n", "Train Epoch: 2 [43520/60000 (72%)]\tLoss: 0.151405\n", "Train Epoch: 2 [44160/60000 (74%)]\tLoss: 0.107737\n", "Train Epoch: 2 [44800/60000 (75%)]\tLoss: 0.128466\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Train Epoch: 2 [45440/60000 (76%)]\tLoss: 0.053797\n", "Train Epoch: 2 [46080/60000 (77%)]\tLoss: 0.154935\n", "Train Epoch: 2 [46720/60000 (78%)]\tLoss: 0.194024\n", "Train Epoch: 2 [47360/60000 (79%)]\tLoss: 0.294160\n", "Train Epoch: 2 [48000/60000 (80%)]\tLoss: 0.099992\n", "Train Epoch: 2 [48640/60000 (81%)]\tLoss: 0.087606\n", "Train Epoch: 2 [49280/60000 (82%)]\tLoss: 0.183729\n", "Train Epoch: 2 [49920/60000 (83%)]\tLoss: 0.141140\n", "Train Epoch: 2 [50560/60000 (84%)]\tLoss: 0.125951\n", "Train Epoch: 2 [51200/60000 (85%)]\tLoss: 0.123601\n", "Train Epoch: 2 [51840/60000 (86%)]\tLoss: 0.118632\n", "Train Epoch: 2 [52480/60000 (87%)]\tLoss: 0.148925\n", "Train Epoch: 2 [53120/60000 (88%)]\tLoss: 0.099077\n", "Train Epoch: 2 [53760/60000 (90%)]\tLoss: 0.085571\n", "Train Epoch: 2 [54400/60000 (91%)]\tLoss: 0.195109\n", "Train Epoch: 2 [55040/60000 (92%)]\tLoss: 0.227440\n", "Train Epoch: 2 [55680/60000 (93%)]\tLoss: 0.164445\n", "Train Epoch: 2 [56320/60000 (94%)]\tLoss: 0.260439\n", "Train Epoch: 2 [56960/60000 (95%)]\tLoss: 0.159982\n", "Train Epoch: 2 [57600/60000 (96%)]\tLoss: 0.029597\n", "Train Epoch: 2 [58240/60000 (97%)]\tLoss: 0.105098\n", "Train Epoch: 2 [58880/60000 (98%)]\tLoss: 0.196359\n", "Train Epoch: 2 [59520/60000 (99%)]\tLoss: 0.070338\n", "\n", "Test set: Average loss: 0.1250, Accuracy: 9608/10000 (96%)\n", "\n", "Train Epoch: 3 [0/60000 (0%)]\tLoss: 0.040007\n", "Train Epoch: 3 [640/60000 (1%)]\tLoss: 0.248919\n", "Train Epoch: 3 [1280/60000 (2%)]\tLoss: 0.074527\n", "Train Epoch: 3 [1920/60000 (3%)]\tLoss: 0.189133\n", "Train Epoch: 3 [2560/60000 (4%)]\tLoss: 0.093020\n", "Train Epoch: 3 [3200/60000 (5%)]\tLoss: 0.053741\n", "Train Epoch: 3 [3840/60000 (6%)]\tLoss: 0.180040\n", "Train Epoch: 3 [4480/60000 (7%)]\tLoss: 0.139165\n", "Train Epoch: 3 [5120/60000 (9%)]\tLoss: 0.057119\n", "Train Epoch: 3 [5760/60000 (10%)]\tLoss: 0.204343\n", "Train Epoch: 3 [6400/60000 (11%)]\tLoss: 0.220169\n", "Train Epoch: 3 [7040/60000 (12%)]\tLoss: 0.063202\n", "Train Epoch: 3 [7680/60000 (13%)]\tLoss: 0.085821\n", "Train Epoch: 3 [8320/60000 (14%)]\tLoss: 0.142111\n", "Train Epoch: 3 [8960/60000 (15%)]\tLoss: 0.078984\n", "Train Epoch: 3 [9600/60000 (16%)]\tLoss: 0.241192\n", "Train Epoch: 3 [10240/60000 (17%)]\tLoss: 0.097471\n", "Train Epoch: 3 [10880/60000 (18%)]\tLoss: 0.215299\n", "Train Epoch: 3 [11520/60000 (19%)]\tLoss: 0.143464\n", "Train Epoch: 3 [12160/60000 (20%)]\tLoss: 0.061797\n", "Train Epoch: 3 [12800/60000 (21%)]\tLoss: 0.290972\n", "Train Epoch: 3 [13440/60000 (22%)]\tLoss: 0.155117\n", "Train Epoch: 3 [14080/60000 (23%)]\tLoss: 0.199297\n", "Train Epoch: 3 [14720/60000 (25%)]\tLoss: 0.033213\n", "Train Epoch: 3 [15360/60000 (26%)]\tLoss: 0.081352\n", "Train Epoch: 3 [16000/60000 (27%)]\tLoss: 0.191277\n", "Train Epoch: 3 [16640/60000 (28%)]\tLoss: 0.047808\n", "Train Epoch: 3 [17280/60000 (29%)]\tLoss: 0.107605\n", "Train Epoch: 3 [17920/60000 (30%)]\tLoss: 0.063272\n", "Train Epoch: 3 [18560/60000 (31%)]\tLoss: 0.292712\n", "Train Epoch: 3 [19200/60000 (32%)]\tLoss: 0.243092\n", "Train Epoch: 3 [19840/60000 (33%)]\tLoss: 0.099812\n", "Train Epoch: 3 [20480/60000 (34%)]\tLoss: 0.028680\n", "Train Epoch: 3 [21120/60000 (35%)]\tLoss: 0.403855\n", "Train Epoch: 3 [21760/60000 (36%)]\tLoss: 0.304837\n", "Train Epoch: 3 [22400/60000 (37%)]\tLoss: 0.070343\n", "Train Epoch: 3 [23040/60000 (38%)]\tLoss: 0.090552\n", "Train Epoch: 3 [23680/60000 (39%)]\tLoss: 0.069524\n", "Train Epoch: 3 [24320/60000 (41%)]\tLoss: 0.035546\n", "Train Epoch: 3 [24960/60000 (42%)]\tLoss: 0.082431\n", "Train Epoch: 3 [25600/60000 (43%)]\tLoss: 0.079616\n", "Train Epoch: 3 [26240/60000 (44%)]\tLoss: 0.152923\n", "Train Epoch: 3 [26880/60000 (45%)]\tLoss: 0.178527\n", "Train Epoch: 3 [27520/60000 (46%)]\tLoss: 0.098369\n", "Train Epoch: 3 [28160/60000 (47%)]\tLoss: 0.056504\n", "Train Epoch: 3 [28800/60000 (48%)]\tLoss: 0.123448\n", "Train Epoch: 3 [29440/60000 (49%)]\tLoss: 0.186487\n", "Train Epoch: 3 [30080/60000 (50%)]\tLoss: 0.112392\n", "Train Epoch: 3 [30720/60000 (51%)]\tLoss: 0.141171\n", "Train Epoch: 3 [31360/60000 (52%)]\tLoss: 0.076075\n", "Train Epoch: 3 [32000/60000 (53%)]\tLoss: 0.290630\n", "Train Epoch: 3 [32640/60000 (54%)]\tLoss: 0.071515\n", "Train Epoch: 3 [33280/60000 (55%)]\tLoss: 0.114186\n", "Train Epoch: 3 [33920/60000 (57%)]\tLoss: 0.222755\n", "Train Epoch: 3 [34560/60000 (58%)]\tLoss: 0.120789\n", "Train Epoch: 3 [35200/60000 (59%)]\tLoss: 0.157404\n", "Train Epoch: 3 [35840/60000 (60%)]\tLoss: 0.211034\n", "Train Epoch: 3 [36480/60000 (61%)]\tLoss: 0.075546\n", "Train Epoch: 3 [37120/60000 (62%)]\tLoss: 0.117283\n", "Train Epoch: 3 [37760/60000 (63%)]\tLoss: 0.081512\n", "Train Epoch: 3 [38400/60000 (64%)]\tLoss: 0.232778\n", "Train Epoch: 3 [39040/60000 (65%)]\tLoss: 0.180055\n", "Train Epoch: 3 [39680/60000 (66%)]\tLoss: 0.156425\n", "Train Epoch: 3 [40320/60000 (67%)]\tLoss: 0.060988\n", "Train Epoch: 3 [40960/60000 (68%)]\tLoss: 0.411666\n", "Train Epoch: 3 [41600/60000 (69%)]\tLoss: 0.080556\n", "Train Epoch: 3 [42240/60000 (70%)]\tLoss: 0.045654\n", "Train Epoch: 3 [42880/60000 (71%)]\tLoss: 0.208916\n", "Train Epoch: 3 [43520/60000 (72%)]\tLoss: 0.020835\n", "Train Epoch: 3 [44160/60000 (74%)]\tLoss: 0.052317\n", "Train Epoch: 3 [44800/60000 (75%)]\tLoss: 0.069176\n", "Train Epoch: 3 [45440/60000 (76%)]\tLoss: 0.146859\n", "Train Epoch: 3 [46080/60000 (77%)]\tLoss: 0.100137\n", "Train Epoch: 3 [46720/60000 (78%)]\tLoss: 0.037533\n", "Train Epoch: 3 [47360/60000 (79%)]\tLoss: 0.083994\n", "Train Epoch: 3 [48000/60000 (80%)]\tLoss: 0.165170\n", "Train Epoch: 3 [48640/60000 (81%)]\tLoss: 0.060811\n", "Train Epoch: 3 [49280/60000 (82%)]\tLoss: 0.048009\n", "Train Epoch: 3 [49920/60000 (83%)]\tLoss: 0.063743\n", "Train Epoch: 3 [50560/60000 (84%)]\tLoss: 0.079445\n", "Train Epoch: 3 [51200/60000 (85%)]\tLoss: 0.069600\n", "Train Epoch: 3 [51840/60000 (86%)]\tLoss: 0.072246\n", "Train Epoch: 3 [52480/60000 (87%)]\tLoss: 0.127083\n", "Train Epoch: 3 [53120/60000 (88%)]\tLoss: 0.049970\n", "Train Epoch: 3 [53760/60000 (90%)]\tLoss: 0.070174\n", "Train Epoch: 3 [54400/60000 (91%)]\tLoss: 0.197476\n", "Train Epoch: 3 [55040/60000 (92%)]\tLoss: 0.030663\n", "Train Epoch: 3 [55680/60000 (93%)]\tLoss: 0.047972\n", "Train Epoch: 3 [56320/60000 (94%)]\tLoss: 0.106370\n", "Train Epoch: 3 [56960/60000 (95%)]\tLoss: 0.098763\n", "Train Epoch: 3 [57600/60000 (96%)]\tLoss: 0.120673\n", "Train Epoch: 3 [58240/60000 (97%)]\tLoss: 0.105097\n", "Train Epoch: 3 [58880/60000 (98%)]\tLoss: 0.216811\n", "Train Epoch: 3 [59520/60000 (99%)]\tLoss: 0.030821\n", "\n", "Test set: Average loss: 0.0861, Accuracy: 9740/10000 (97%)\n", "\n", "Train Epoch: 4 [0/60000 (0%)]\tLoss: 0.058603\n", "Train Epoch: 4 [640/60000 (1%)]\tLoss: 0.068518\n", "Train Epoch: 4 [1280/60000 (2%)]\tLoss: 0.045707\n", "Train Epoch: 4 [1920/60000 (3%)]\tLoss: 0.124151\n", "Train Epoch: 4 [2560/60000 (4%)]\tLoss: 0.131996\n", "Train Epoch: 4 [3200/60000 (5%)]\tLoss: 0.103385\n", "Train Epoch: 4 [3840/60000 (6%)]\tLoss: 0.057419\n", "Train Epoch: 4 [4480/60000 (7%)]\tLoss: 0.171233\n", "Train Epoch: 4 [5120/60000 (9%)]\tLoss: 0.057822\n", "Train Epoch: 4 [5760/60000 (10%)]\tLoss: 0.099908\n", "Train Epoch: 4 [6400/60000 (11%)]\tLoss: 0.068817\n", "Train Epoch: 4 [7040/60000 (12%)]\tLoss: 0.040263\n", "Train Epoch: 4 [7680/60000 (13%)]\tLoss: 0.103096\n", "Train Epoch: 4 [8320/60000 (14%)]\tLoss: 0.068251\n", "Train Epoch: 4 [8960/60000 (15%)]\tLoss: 0.075589\n", "Train Epoch: 4 [9600/60000 (16%)]\tLoss: 0.255151\n", "Train Epoch: 4 [10240/60000 (17%)]\tLoss: 0.021581\n", "Train Epoch: 4 [10880/60000 (18%)]\tLoss: 0.064106\n", "Train Epoch: 4 [11520/60000 (19%)]\tLoss: 0.050146\n", "Train Epoch: 4 [12160/60000 (20%)]\tLoss: 0.060758\n", "Train Epoch: 4 [12800/60000 (21%)]\tLoss: 0.150228\n", "Train Epoch: 4 [13440/60000 (22%)]\tLoss: 0.077774\n", "Train Epoch: 4 [14080/60000 (23%)]\tLoss: 0.123523\n", "Train Epoch: 4 [14720/60000 (25%)]\tLoss: 0.057074\n", "Train Epoch: 4 [15360/60000 (26%)]\tLoss: 0.092370\n", "Train Epoch: 4 [16000/60000 (27%)]\tLoss: 0.111632\n", "Train Epoch: 4 [16640/60000 (28%)]\tLoss: 0.042093\n", "Train Epoch: 4 [17280/60000 (29%)]\tLoss: 0.039304\n", "Train Epoch: 4 [17920/60000 (30%)]\tLoss: 0.119649\n", "Train Epoch: 4 [18560/60000 (31%)]\tLoss: 0.163330\n", "Train Epoch: 4 [19200/60000 (32%)]\tLoss: 0.035465\n", "Train Epoch: 4 [19840/60000 (33%)]\tLoss: 0.074450\n", "Train Epoch: 4 [20480/60000 (34%)]\tLoss: 0.065414\n", "Train Epoch: 4 [21120/60000 (35%)]\tLoss: 0.040539\n", "Train Epoch: 4 [21760/60000 (36%)]\tLoss: 0.148224\n", "Train Epoch: 4 [22400/60000 (37%)]\tLoss: 0.156781\n", "Train Epoch: 4 [23040/60000 (38%)]\tLoss: 0.045047\n", "Train Epoch: 4 [23680/60000 (39%)]\tLoss: 0.055257\n", "Train Epoch: 4 [24320/60000 (41%)]\tLoss: 0.054676\n", "Train Epoch: 4 [24960/60000 (42%)]\tLoss: 0.158515\n", "Train Epoch: 4 [25600/60000 (43%)]\tLoss: 0.128929\n", "Train Epoch: 4 [26240/60000 (44%)]\tLoss: 0.108329\n", "Train Epoch: 4 [26880/60000 (45%)]\tLoss: 0.135030\n", "Train Epoch: 4 [27520/60000 (46%)]\tLoss: 0.039639\n", "Train Epoch: 4 [28160/60000 (47%)]\tLoss: 0.033988\n", "Train Epoch: 4 [28800/60000 (48%)]\tLoss: 0.026609\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Train Epoch: 4 [29440/60000 (49%)]\tLoss: 0.034178\n", "Train Epoch: 4 [30080/60000 (50%)]\tLoss: 0.046107\n", "Train Epoch: 4 [30720/60000 (51%)]\tLoss: 0.011578\n", "Train Epoch: 4 [31360/60000 (52%)]\tLoss: 0.110122\n", "Train Epoch: 4 [32000/60000 (53%)]\tLoss: 0.103868\n", "Train Epoch: 4 [32640/60000 (54%)]\tLoss: 0.151878\n", "Train Epoch: 4 [33280/60000 (55%)]\tLoss: 0.043182\n", "Train Epoch: 4 [33920/60000 (57%)]\tLoss: 0.124207\n", "Train Epoch: 4 [34560/60000 (58%)]\tLoss: 0.080034\n", "Train Epoch: 4 [35200/60000 (59%)]\tLoss: 0.162287\n", "Train Epoch: 4 [35840/60000 (60%)]\tLoss: 0.126800\n", "Train Epoch: 4 [36480/60000 (61%)]\tLoss: 0.061211\n", "Train Epoch: 4 [37120/60000 (62%)]\tLoss: 0.102037\n", "Train Epoch: 4 [37760/60000 (63%)]\tLoss: 0.059467\n", "Train Epoch: 4 [38400/60000 (64%)]\tLoss: 0.194096\n", "Train Epoch: 4 [39040/60000 (65%)]\tLoss: 0.106487\n", "Train Epoch: 4 [39680/60000 (66%)]\tLoss: 0.044351\n", "Train Epoch: 4 [40320/60000 (67%)]\tLoss: 0.089831\n", "Train Epoch: 4 [40960/60000 (68%)]\tLoss: 0.099313\n", "Train Epoch: 4 [41600/60000 (69%)]\tLoss: 0.036939\n", "Train Epoch: 4 [42240/60000 (70%)]\tLoss: 0.137625\n", "Train Epoch: 4 [42880/60000 (71%)]\tLoss: 0.095748\n", "Train Epoch: 4 [43520/60000 (72%)]\tLoss: 0.080863\n", "Train Epoch: 4 [44160/60000 (74%)]\tLoss: 0.078053\n", "Train Epoch: 4 [44800/60000 (75%)]\tLoss: 0.200218\n", "Train Epoch: 4 [45440/60000 (76%)]\tLoss: 0.098379\n", "Train Epoch: 4 [46080/60000 (77%)]\tLoss: 0.039777\n", "Train Epoch: 4 [46720/60000 (78%)]\tLoss: 0.041870\n", "Train Epoch: 4 [47360/60000 (79%)]\tLoss: 0.044499\n", "Train Epoch: 4 [48000/60000 (80%)]\tLoss: 0.088943\n", "Train Epoch: 4 [48640/60000 (81%)]\tLoss: 0.122270\n", "Train Epoch: 4 [49280/60000 (82%)]\tLoss: 0.139814\n", "Train Epoch: 4 [49920/60000 (83%)]\tLoss: 0.170997\n", "Train Epoch: 4 [50560/60000 (84%)]\tLoss: 0.076264\n", "Train Epoch: 4 [51200/60000 (85%)]\tLoss: 0.035964\n", "Train Epoch: 4 [51840/60000 (86%)]\tLoss: 0.050548\n", "Train Epoch: 4 [52480/60000 (87%)]\tLoss: 0.028624\n", "Train Epoch: 4 [53120/60000 (88%)]\tLoss: 0.017791\n", "Train Epoch: 4 [53760/60000 (90%)]\tLoss: 0.167684\n", "Train Epoch: 4 [54400/60000 (91%)]\tLoss: 0.127051\n", "Train Epoch: 4 [55040/60000 (92%)]\tLoss: 0.087644\n", "Train Epoch: 4 [55680/60000 (93%)]\tLoss: 0.214866\n", "Train Epoch: 4 [56320/60000 (94%)]\tLoss: 0.118833\n", "Train Epoch: 4 [56960/60000 (95%)]\tLoss: 0.031988\n", "Train Epoch: 4 [57600/60000 (96%)]\tLoss: 0.060099\n", "Train Epoch: 4 [58240/60000 (97%)]\tLoss: 0.107616\n", "Train Epoch: 4 [58880/60000 (98%)]\tLoss: 0.107447\n", "Train Epoch: 4 [59520/60000 (99%)]\tLoss: 0.052308\n", "\n", "Test set: Average loss: 0.0799, Accuracy: 9755/10000 (98%)\n", "\n", "Train Epoch: 5 [0/60000 (0%)]\tLoss: 0.066949\n", "Train Epoch: 5 [640/60000 (1%)]\tLoss: 0.105724\n", "Train Epoch: 5 [1280/60000 (2%)]\tLoss: 0.045400\n", "Train Epoch: 5 [1920/60000 (3%)]\tLoss: 0.109869\n", "Train Epoch: 5 [2560/60000 (4%)]\tLoss: 0.039605\n", "Train Epoch: 5 [3200/60000 (5%)]\tLoss: 0.257772\n", "Train Epoch: 5 [3840/60000 (6%)]\tLoss: 0.041636\n", "Train Epoch: 5 [4480/60000 (7%)]\tLoss: 0.053628\n", "Train Epoch: 5 [5120/60000 (9%)]\tLoss: 0.041203\n", "Train Epoch: 5 [5760/60000 (10%)]\tLoss: 0.062662\n", "Train Epoch: 5 [6400/60000 (11%)]\tLoss: 0.042457\n", "Train Epoch: 5 [7040/60000 (12%)]\tLoss: 0.069447\n", "Train Epoch: 5 [7680/60000 (13%)]\tLoss: 0.263487\n", "Train Epoch: 5 [8320/60000 (14%)]\tLoss: 0.121907\n", "Train Epoch: 5 [8960/60000 (15%)]\tLoss: 0.112867\n", "Train Epoch: 5 [9600/60000 (16%)]\tLoss: 0.033646\n", "Train Epoch: 5 [10240/60000 (17%)]\tLoss: 0.034200\n", "Train Epoch: 5 [10880/60000 (18%)]\tLoss: 0.124646\n", "Train Epoch: 5 [11520/60000 (19%)]\tLoss: 0.091527\n", "Train Epoch: 5 [12160/60000 (20%)]\tLoss: 0.353837\n", "Train Epoch: 5 [12800/60000 (21%)]\tLoss: 0.046651\n", "Train Epoch: 5 [13440/60000 (22%)]\tLoss: 0.055895\n", "Train Epoch: 5 [14080/60000 (23%)]\tLoss: 0.066822\n", "Train Epoch: 5 [14720/60000 (25%)]\tLoss: 0.060584\n", "Train Epoch: 5 [15360/60000 (26%)]\tLoss: 0.077524\n", "Train Epoch: 5 [16000/60000 (27%)]\tLoss: 0.029719\n", "Train Epoch: 5 [16640/60000 (28%)]\tLoss: 0.060994\n", "Train Epoch: 5 [17280/60000 (29%)]\tLoss: 0.051796\n", "Train Epoch: 5 [17920/60000 (30%)]\tLoss: 0.166119\n", "Train Epoch: 5 [18560/60000 (31%)]\tLoss: 0.034461\n", "Train Epoch: 5 [19200/60000 (32%)]\tLoss: 0.165760\n", "Train Epoch: 5 [19840/60000 (33%)]\tLoss: 0.061641\n", "Train Epoch: 5 [20480/60000 (34%)]\tLoss: 0.070632\n", "Train Epoch: 5 [21120/60000 (35%)]\tLoss: 0.170699\n", "Train Epoch: 5 [21760/60000 (36%)]\tLoss: 0.023626\n", "Train Epoch: 5 [22400/60000 (37%)]\tLoss: 0.086088\n", "Train Epoch: 5 [23040/60000 (38%)]\tLoss: 0.033582\n", "Train Epoch: 5 [23680/60000 (39%)]\tLoss: 0.028206\n", "Train Epoch: 5 [24320/60000 (41%)]\tLoss: 0.088071\n", "Train Epoch: 5 [24960/60000 (42%)]\tLoss: 0.115715\n", "Train Epoch: 5 [25600/60000 (43%)]\tLoss: 0.061839\n", "Train Epoch: 5 [26240/60000 (44%)]\tLoss: 0.143530\n", "Train Epoch: 5 [26880/60000 (45%)]\tLoss: 0.056764\n", "Train Epoch: 5 [27520/60000 (46%)]\tLoss: 0.012387\n", "Train Epoch: 5 [28160/60000 (47%)]\tLoss: 0.070412\n", "Train Epoch: 5 [28800/60000 (48%)]\tLoss: 0.017625\n", "Train Epoch: 5 [29440/60000 (49%)]\tLoss: 0.040521\n", "Train Epoch: 5 [30080/60000 (50%)]\tLoss: 0.191649\n", "Train Epoch: 5 [30720/60000 (51%)]\tLoss: 0.052033\n", "Train Epoch: 5 [31360/60000 (52%)]\tLoss: 0.042508\n", "Train Epoch: 5 [32000/60000 (53%)]\tLoss: 0.038528\n", "Train Epoch: 5 [32640/60000 (54%)]\tLoss: 0.122223\n", "Train Epoch: 5 [33280/60000 (55%)]\tLoss: 0.196624\n", "Train Epoch: 5 [33920/60000 (57%)]\tLoss: 0.127779\n", "Train Epoch: 5 [34560/60000 (58%)]\tLoss: 0.031086\n", "Train Epoch: 5 [35200/60000 (59%)]\tLoss: 0.071768\n", "Train Epoch: 5 [35840/60000 (60%)]\tLoss: 0.043593\n", "Train Epoch: 5 [36480/60000 (61%)]\tLoss: 0.377297\n", "Train Epoch: 5 [37120/60000 (62%)]\tLoss: 0.058385\n", "Train Epoch: 5 [37760/60000 (63%)]\tLoss: 0.025936\n", "Train Epoch: 5 [38400/60000 (64%)]\tLoss: 0.030584\n", "Train Epoch: 5 [39040/60000 (65%)]\tLoss: 0.017796\n", "Train Epoch: 5 [39680/60000 (66%)]\tLoss: 0.024442\n", "Train Epoch: 5 [40320/60000 (67%)]\tLoss: 0.028882\n", "Train Epoch: 5 [40960/60000 (68%)]\tLoss: 0.068706\n", "Train Epoch: 5 [41600/60000 (69%)]\tLoss: 0.075895\n", "Train Epoch: 5 [42240/60000 (70%)]\tLoss: 0.124433\n", "Train Epoch: 5 [42880/60000 (71%)]\tLoss: 0.128258\n", "Train Epoch: 5 [43520/60000 (72%)]\tLoss: 0.078347\n", "Train Epoch: 5 [44160/60000 (74%)]\tLoss: 0.029931\n", "Train Epoch: 5 [44800/60000 (75%)]\tLoss: 0.137046\n", "Train Epoch: 5 [45440/60000 (76%)]\tLoss: 0.163048\n", "Train Epoch: 5 [46080/60000 (77%)]\tLoss: 0.025973\n", "Train Epoch: 5 [46720/60000 (78%)]\tLoss: 0.170867\n", "Train Epoch: 5 [47360/60000 (79%)]\tLoss: 0.061204\n", "Train Epoch: 5 [48000/60000 (80%)]\tLoss: 0.157926\n", "Train Epoch: 5 [48640/60000 (81%)]\tLoss: 0.118524\n", "Train Epoch: 5 [49280/60000 (82%)]\tLoss: 0.148709\n", "Train Epoch: 5 [49920/60000 (83%)]\tLoss: 0.109538\n", "Train Epoch: 5 [50560/60000 (84%)]\tLoss: 0.049127\n", "Train Epoch: 5 [51200/60000 (85%)]\tLoss: 0.016073\n", "Train Epoch: 5 [51840/60000 (86%)]\tLoss: 0.054222\n", "Train Epoch: 5 [52480/60000 (87%)]\tLoss: 0.043101\n", "Train Epoch: 5 [53120/60000 (88%)]\tLoss: 0.097749\n", "Train Epoch: 5 [53760/60000 (90%)]\tLoss: 0.082099\n", "Train Epoch: 5 [54400/60000 (91%)]\tLoss: 0.036863\n", "Train Epoch: 5 [55040/60000 (92%)]\tLoss: 0.114467\n", "Train Epoch: 5 [55680/60000 (93%)]\tLoss: 0.049331\n", "Train Epoch: 5 [56320/60000 (94%)]\tLoss: 0.070385\n", "Train Epoch: 5 [56960/60000 (95%)]\tLoss: 0.134488\n", "Train Epoch: 5 [57600/60000 (96%)]\tLoss: 0.036805\n", "Train Epoch: 5 [58240/60000 (97%)]\tLoss: 0.092324\n", "Train Epoch: 5 [58880/60000 (98%)]\tLoss: 0.035891\n", "Train Epoch: 5 [59520/60000 (99%)]\tLoss: 0.125011\n", "\n", "Test set: Average loss: 0.0678, Accuracy: 9802/10000 (98%)\n", "\n", "Train Epoch: 6 [0/60000 (0%)]\tLoss: 0.056992\n", "Train Epoch: 6 [640/60000 (1%)]\tLoss: 0.139214\n", "Train Epoch: 6 [1280/60000 (2%)]\tLoss: 0.047416\n", "Train Epoch: 6 [1920/60000 (3%)]\tLoss: 0.119811\n", "Train Epoch: 6 [2560/60000 (4%)]\tLoss: 0.048472\n", "Train Epoch: 6 [3200/60000 (5%)]\tLoss: 0.163104\n", "Train Epoch: 6 [3840/60000 (6%)]\tLoss: 0.133608\n", "Train Epoch: 6 [4480/60000 (7%)]\tLoss: 0.002732\n", "Train Epoch: 6 [5120/60000 (9%)]\tLoss: 0.106044\n", "Train Epoch: 6 [5760/60000 (10%)]\tLoss: 0.060719\n", "Train Epoch: 6 [6400/60000 (11%)]\tLoss: 0.051498\n", "Train Epoch: 6 [7040/60000 (12%)]\tLoss: 0.117920\n", "Train Epoch: 6 [7680/60000 (13%)]\tLoss: 0.226335\n", "Train Epoch: 6 [8320/60000 (14%)]\tLoss: 0.075708\n", "Train Epoch: 6 [8960/60000 (15%)]\tLoss: 0.017281\n", "Train Epoch: 6 [9600/60000 (16%)]\tLoss: 0.021267\n", "Train Epoch: 6 [10240/60000 (17%)]\tLoss: 0.026917\n", "Train Epoch: 6 [10880/60000 (18%)]\tLoss: 0.083198\n", "Train Epoch: 6 [11520/60000 (19%)]\tLoss: 0.048965\n", "Train Epoch: 6 [12160/60000 (20%)]\tLoss: 0.033739\n", "Train Epoch: 6 [12800/60000 (21%)]\tLoss: 0.065381\n", "Train Epoch: 6 [13440/60000 (22%)]\tLoss: 0.054494\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Train Epoch: 6 [14080/60000 (23%)]\tLoss: 0.202451\n", "Train Epoch: 6 [14720/60000 (25%)]\tLoss: 0.077869\n", "Train Epoch: 6 [15360/60000 (26%)]\tLoss: 0.085073\n", "Train Epoch: 6 [16000/60000 (27%)]\tLoss: 0.013286\n", "Train Epoch: 6 [16640/60000 (28%)]\tLoss: 0.058315\n", "Train Epoch: 6 [17280/60000 (29%)]\tLoss: 0.073047\n", "Train Epoch: 6 [17920/60000 (30%)]\tLoss: 0.038334\n", "Train Epoch: 6 [18560/60000 (31%)]\tLoss: 0.054286\n", "Train Epoch: 6 [19200/60000 (32%)]\tLoss: 0.046039\n", "Train Epoch: 6 [19840/60000 (33%)]\tLoss: 0.035886\n", "Train Epoch: 6 [20480/60000 (34%)]\tLoss: 0.085488\n", "Train Epoch: 6 [21120/60000 (35%)]\tLoss: 0.077075\n", "Train Epoch: 6 [21760/60000 (36%)]\tLoss: 0.089925\n", "Train Epoch: 6 [22400/60000 (37%)]\tLoss: 0.150688\n", "Train Epoch: 6 [23040/60000 (38%)]\tLoss: 0.119949\n", "Train Epoch: 6 [23680/60000 (39%)]\tLoss: 0.083399\n", "Train Epoch: 6 [24320/60000 (41%)]\tLoss: 0.060827\n", "Train Epoch: 6 [24960/60000 (42%)]\tLoss: 0.192299\n", "Train Epoch: 6 [25600/60000 (43%)]\tLoss: 0.049599\n", "Train Epoch: 6 [26240/60000 (44%)]\tLoss: 0.037659\n", "Train Epoch: 6 [26880/60000 (45%)]\tLoss: 0.053850\n", "Train Epoch: 6 [27520/60000 (46%)]\tLoss: 0.011844\n", "Train Epoch: 6 [28160/60000 (47%)]\tLoss: 0.030450\n", "Train Epoch: 6 [28800/60000 (48%)]\tLoss: 0.076021\n", "Train Epoch: 6 [29440/60000 (49%)]\tLoss: 0.166136\n", "Train Epoch: 6 [30080/60000 (50%)]\tLoss: 0.030463\n", "Train Epoch: 6 [30720/60000 (51%)]\tLoss: 0.111804\n", "Train Epoch: 6 [31360/60000 (52%)]\tLoss: 0.013492\n", "Train Epoch: 6 [32000/60000 (53%)]\tLoss: 0.058684\n", "Train Epoch: 6 [32640/60000 (54%)]\tLoss: 0.125379\n", "Train Epoch: 6 [33280/60000 (55%)]\tLoss: 0.400959\n", "Train Epoch: 6 [33920/60000 (57%)]\tLoss: 0.161736\n", "Train Epoch: 6 [34560/60000 (58%)]\tLoss: 0.068050\n", "Train Epoch: 6 [35200/60000 (59%)]\tLoss: 0.082666\n", "Train Epoch: 6 [35840/60000 (60%)]\tLoss: 0.039739\n", "Train Epoch: 6 [36480/60000 (61%)]\tLoss: 0.124332\n", "Train Epoch: 6 [37120/60000 (62%)]\tLoss: 0.069341\n", "Train Epoch: 6 [37760/60000 (63%)]\tLoss: 0.110575\n", "Train Epoch: 6 [38400/60000 (64%)]\tLoss: 0.019776\n", "Train Epoch: 6 [39040/60000 (65%)]\tLoss: 0.125340\n", "Train Epoch: 6 [39680/60000 (66%)]\tLoss: 0.289195\n", "Train Epoch: 6 [40320/60000 (67%)]\tLoss: 0.026776\n", "Train Epoch: 6 [40960/60000 (68%)]\tLoss: 0.123123\n", "Train Epoch: 6 [41600/60000 (69%)]\tLoss: 0.095079\n", "Train Epoch: 6 [42240/60000 (70%)]\tLoss: 0.204592\n", "Train Epoch: 6 [42880/60000 (71%)]\tLoss: 0.062658\n", "Train Epoch: 6 [43520/60000 (72%)]\tLoss: 0.062846\n", "Train Epoch: 6 [44160/60000 (74%)]\tLoss: 0.035293\n", "Train Epoch: 6 [44800/60000 (75%)]\tLoss: 0.022750\n", "Train Epoch: 6 [45440/60000 (76%)]\tLoss: 0.029933\n", "Train Epoch: 6 [46080/60000 (77%)]\tLoss: 0.121406\n", "Train Epoch: 6 [46720/60000 (78%)]\tLoss: 0.158908\n", "Train Epoch: 6 [47360/60000 (79%)]\tLoss: 0.053591\n", "Train Epoch: 6 [48000/60000 (80%)]\tLoss: 0.057661\n", "Train Epoch: 6 [48640/60000 (81%)]\tLoss: 0.055967\n", "Train Epoch: 6 [49280/60000 (82%)]\tLoss: 0.021558\n", "Train Epoch: 6 [49920/60000 (83%)]\tLoss: 0.132524\n", "Train Epoch: 6 [50560/60000 (84%)]\tLoss: 0.059439\n", "Train Epoch: 6 [51200/60000 (85%)]\tLoss: 0.065816\n", "Train Epoch: 6 [51840/60000 (86%)]\tLoss: 0.069396\n", "Train Epoch: 6 [52480/60000 (87%)]\tLoss: 0.096557\n", "Train Epoch: 6 [53120/60000 (88%)]\tLoss: 0.020840\n", "Train Epoch: 6 [53760/60000 (90%)]\tLoss: 0.087607\n", "Train Epoch: 6 [54400/60000 (91%)]\tLoss: 0.223364\n", "Train Epoch: 6 [55040/60000 (92%)]\tLoss: 0.036307\n", "Train Epoch: 6 [55680/60000 (93%)]\tLoss: 0.037978\n", "Train Epoch: 6 [56320/60000 (94%)]\tLoss: 0.088568\n", "Train Epoch: 6 [56960/60000 (95%)]\tLoss: 0.015448\n", "Train Epoch: 6 [57600/60000 (96%)]\tLoss: 0.043836\n", "Train Epoch: 6 [58240/60000 (97%)]\tLoss: 0.152100\n", "Train Epoch: 6 [58880/60000 (98%)]\tLoss: 0.046384\n", "Train Epoch: 6 [59520/60000 (99%)]\tLoss: 0.121224\n", "\n", "Test set: Average loss: 0.0627, Accuracy: 9794/10000 (98%)\n", "\n", "Train Epoch: 7 [0/60000 (0%)]\tLoss: 0.038668\n", "Train Epoch: 7 [640/60000 (1%)]\tLoss: 0.152985\n", "Train Epoch: 7 [1280/60000 (2%)]\tLoss: 0.067919\n", "Train Epoch: 7 [1920/60000 (3%)]\tLoss: 0.015419\n", "Train Epoch: 7 [2560/60000 (4%)]\tLoss: 0.066578\n", "Train Epoch: 7 [3200/60000 (5%)]\tLoss: 0.100658\n", "Train Epoch: 7 [3840/60000 (6%)]\tLoss: 0.005591\n", "Train Epoch: 7 [4480/60000 (7%)]\tLoss: 0.016872\n", "Train Epoch: 7 [5120/60000 (9%)]\tLoss: 0.099707\n", "Train Epoch: 7 [5760/60000 (10%)]\tLoss: 0.026898\n", "Train Epoch: 7 [6400/60000 (11%)]\tLoss: 0.087944\n", "Train Epoch: 7 [7040/60000 (12%)]\tLoss: 0.058212\n", "Train Epoch: 7 [7680/60000 (13%)]\tLoss: 0.122954\n", "Train Epoch: 7 [8320/60000 (14%)]\tLoss: 0.092256\n", "Train Epoch: 7 [8960/60000 (15%)]\tLoss: 0.026217\n", "Train Epoch: 7 [9600/60000 (16%)]\tLoss: 0.064904\n", "Train Epoch: 7 [10240/60000 (17%)]\tLoss: 0.031789\n", "Train Epoch: 7 [10880/60000 (18%)]\tLoss: 0.120419\n", "Train Epoch: 7 [11520/60000 (19%)]\tLoss: 0.012021\n", "Train Epoch: 7 [12160/60000 (20%)]\tLoss: 0.054026\n", "Train Epoch: 7 [12800/60000 (21%)]\tLoss: 0.026579\n", "Train Epoch: 7 [13440/60000 (22%)]\tLoss: 0.101119\n", "Train Epoch: 7 [14080/60000 (23%)]\tLoss: 0.042643\n", "Train Epoch: 7 [14720/60000 (25%)]\tLoss: 0.031907\n", "Train Epoch: 7 [15360/60000 (26%)]\tLoss: 0.009277\n", "Train Epoch: 7 [16000/60000 (27%)]\tLoss: 0.054256\n", "Train Epoch: 7 [16640/60000 (28%)]\tLoss: 0.017699\n", "Train Epoch: 7 [17280/60000 (29%)]\tLoss: 0.009340\n", "Train Epoch: 7 [17920/60000 (30%)]\tLoss: 0.035420\n", "Train Epoch: 7 [18560/60000 (31%)]\tLoss: 0.082220\n", "Train Epoch: 7 [19200/60000 (32%)]\tLoss: 0.016140\n", "Train Epoch: 7 [19840/60000 (33%)]\tLoss: 0.199725\n", "Train Epoch: 7 [20480/60000 (34%)]\tLoss: 0.142392\n", "Train Epoch: 7 [21120/60000 (35%)]\tLoss: 0.106283\n", "Train Epoch: 7 [21760/60000 (36%)]\tLoss: 0.013798\n", "Train Epoch: 7 [22400/60000 (37%)]\tLoss: 0.053685\n", "Train Epoch: 7 [23040/60000 (38%)]\tLoss: 0.036926\n", "Train Epoch: 7 [23680/60000 (39%)]\tLoss: 0.097976\n", "Train Epoch: 7 [24320/60000 (41%)]\tLoss: 0.061216\n", "Train Epoch: 7 [24960/60000 (42%)]\tLoss: 0.043279\n", "Train Epoch: 7 [25600/60000 (43%)]\tLoss: 0.024839\n", "Train Epoch: 7 [26240/60000 (44%)]\tLoss: 0.141898\n", "Train Epoch: 7 [26880/60000 (45%)]\tLoss: 0.017919\n", "Train Epoch: 7 [27520/60000 (46%)]\tLoss: 0.016729\n", "Train Epoch: 7 [28160/60000 (47%)]\tLoss: 0.104839\n", "Train Epoch: 7 [28800/60000 (48%)]\tLoss: 0.044670\n", "Train Epoch: 7 [29440/60000 (49%)]\tLoss: 0.057063\n", "Train Epoch: 7 [30080/60000 (50%)]\tLoss: 0.118510\n", "Train Epoch: 7 [30720/60000 (51%)]\tLoss: 0.085390\n", "Train Epoch: 7 [31360/60000 (52%)]\tLoss: 0.027877\n", "Train Epoch: 7 [32000/60000 (53%)]\tLoss: 0.029926\n", "Train Epoch: 7 [32640/60000 (54%)]\tLoss: 0.020083\n", "Train Epoch: 7 [33280/60000 (55%)]\tLoss: 0.185776\n", "Train Epoch: 7 [33920/60000 (57%)]\tLoss: 0.036906\n", "Train Epoch: 7 [34560/60000 (58%)]\tLoss: 0.054783\n", "Train Epoch: 7 [35200/60000 (59%)]\tLoss: 0.047408\n", "Train Epoch: 7 [35840/60000 (60%)]\tLoss: 0.161220\n", "Train Epoch: 7 [36480/60000 (61%)]\tLoss: 0.059554\n", "Train Epoch: 7 [37120/60000 (62%)]\tLoss: 0.178432\n", "Train Epoch: 7 [37760/60000 (63%)]\tLoss: 0.042241\n", "Train Epoch: 7 [38400/60000 (64%)]\tLoss: 0.091979\n", "Train Epoch: 7 [39040/60000 (65%)]\tLoss: 0.052732\n", "Train Epoch: 7 [39680/60000 (66%)]\tLoss: 0.024201\n", "Train Epoch: 7 [40320/60000 (67%)]\tLoss: 0.092958\n", "Train Epoch: 7 [40960/60000 (68%)]\tLoss: 0.050351\n", "Train Epoch: 7 [41600/60000 (69%)]\tLoss: 0.089817\n", "Train Epoch: 7 [42240/60000 (70%)]\tLoss: 0.132323\n", "Train Epoch: 7 [42880/60000 (71%)]\tLoss: 0.008266\n", "Train Epoch: 7 [43520/60000 (72%)]\tLoss: 0.032016\n", "Train Epoch: 7 [44160/60000 (74%)]\tLoss: 0.217488\n", "Train Epoch: 7 [44800/60000 (75%)]\tLoss: 0.039236\n", "Train Epoch: 7 [45440/60000 (76%)]\tLoss: 0.040128\n", "Train Epoch: 7 [46080/60000 (77%)]\tLoss: 0.075809\n", "Train Epoch: 7 [46720/60000 (78%)]\tLoss: 0.054285\n", "Train Epoch: 7 [47360/60000 (79%)]\tLoss: 0.040743\n", "Train Epoch: 7 [48000/60000 (80%)]\tLoss: 0.045380\n", "Train Epoch: 7 [48640/60000 (81%)]\tLoss: 0.045553\n", "Train Epoch: 7 [49280/60000 (82%)]\tLoss: 0.066226\n", "Train Epoch: 7 [49920/60000 (83%)]\tLoss: 0.122073\n", "Train Epoch: 7 [50560/60000 (84%)]\tLoss: 0.056059\n", "Train Epoch: 7 [51200/60000 (85%)]\tLoss: 0.045100\n", "Train Epoch: 7 [51840/60000 (86%)]\tLoss: 0.029869\n", "Train Epoch: 7 [52480/60000 (87%)]\tLoss: 0.041358\n", "Train Epoch: 7 [53120/60000 (88%)]\tLoss: 0.024694\n", "Train Epoch: 7 [53760/60000 (90%)]\tLoss: 0.047613\n", "Train Epoch: 7 [54400/60000 (91%)]\tLoss: 0.053296\n", "Train Epoch: 7 [55040/60000 (92%)]\tLoss: 0.057106\n", "Train Epoch: 7 [55680/60000 (93%)]\tLoss: 0.064469\n", "Train Epoch: 7 [56320/60000 (94%)]\tLoss: 0.008784\n", "Train Epoch: 7 [56960/60000 (95%)]\tLoss: 0.020461\n", "Train Epoch: 7 [57600/60000 (96%)]\tLoss: 0.083198\n", "Train Epoch: 7 [58240/60000 (97%)]\tLoss: 0.031770\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Train Epoch: 7 [58880/60000 (98%)]\tLoss: 0.028213\n", "Train Epoch: 7 [59520/60000 (99%)]\tLoss: 0.095529\n", "\n", "Test set: Average loss: 0.0580, Accuracy: 9822/10000 (98%)\n", "\n", "Train Epoch: 8 [0/60000 (0%)]\tLoss: 0.095277\n", "Train Epoch: 8 [640/60000 (1%)]\tLoss: 0.143193\n", "Train Epoch: 8 [1280/60000 (2%)]\tLoss: 0.028024\n", "Train Epoch: 8 [1920/60000 (3%)]\tLoss: 0.014284\n", "Train Epoch: 8 [2560/60000 (4%)]\tLoss: 0.024069\n", "Train Epoch: 8 [3200/60000 (5%)]\tLoss: 0.044241\n", "Train Epoch: 8 [3840/60000 (6%)]\tLoss: 0.070332\n", "Train Epoch: 8 [4480/60000 (7%)]\tLoss: 0.055925\n", "Train Epoch: 8 [5120/60000 (9%)]\tLoss: 0.093262\n", "Train Epoch: 8 [5760/60000 (10%)]\tLoss: 0.034249\n", "Train Epoch: 8 [6400/60000 (11%)]\tLoss: 0.055211\n", "Train Epoch: 8 [7040/60000 (12%)]\tLoss: 0.022661\n", "Train Epoch: 8 [7680/60000 (13%)]\tLoss: 0.141150\n", "Train Epoch: 8 [8320/60000 (14%)]\tLoss: 0.100695\n", "Train Epoch: 8 [8960/60000 (15%)]\tLoss: 0.027464\n", "Train Epoch: 8 [9600/60000 (16%)]\tLoss: 0.022342\n", "Train Epoch: 8 [10240/60000 (17%)]\tLoss: 0.054020\n", "Train Epoch: 8 [10880/60000 (18%)]\tLoss: 0.205738\n", "Train Epoch: 8 [11520/60000 (19%)]\tLoss: 0.008106\n", "Train Epoch: 8 [12160/60000 (20%)]\tLoss: 0.040244\n", "Train Epoch: 8 [12800/60000 (21%)]\tLoss: 0.138055\n", "Train Epoch: 8 [13440/60000 (22%)]\tLoss: 0.014804\n", "Train Epoch: 8 [14080/60000 (23%)]\tLoss: 0.025389\n", "Train Epoch: 8 [14720/60000 (25%)]\tLoss: 0.023334\n", "Train Epoch: 8 [15360/60000 (26%)]\tLoss: 0.210289\n", "Train Epoch: 8 [16000/60000 (27%)]\tLoss: 0.023116\n", "Train Epoch: 8 [16640/60000 (28%)]\tLoss: 0.031807\n", "Train Epoch: 8 [17280/60000 (29%)]\tLoss: 0.059268\n", "Train Epoch: 8 [17920/60000 (30%)]\tLoss: 0.005770\n", "Train Epoch: 8 [18560/60000 (31%)]\tLoss: 0.046716\n", "Train Epoch: 8 [19200/60000 (32%)]\tLoss: 0.012603\n", "Train Epoch: 8 [19840/60000 (33%)]\tLoss: 0.140218\n", "Train Epoch: 8 [20480/60000 (34%)]\tLoss: 0.020282\n", "Train Epoch: 8 [21120/60000 (35%)]\tLoss: 0.039421\n", "Train Epoch: 8 [21760/60000 (36%)]\tLoss: 0.055249\n", "Train Epoch: 8 [22400/60000 (37%)]\tLoss: 0.211906\n", "Train Epoch: 8 [23040/60000 (38%)]\tLoss: 0.017459\n", "Train Epoch: 8 [23680/60000 (39%)]\tLoss: 0.066078\n", "Train Epoch: 8 [24320/60000 (41%)]\tLoss: 0.046964\n", "Train Epoch: 8 [24960/60000 (42%)]\tLoss: 0.053014\n", "Train Epoch: 8 [25600/60000 (43%)]\tLoss: 0.085308\n", "Train Epoch: 8 [26240/60000 (44%)]\tLoss: 0.015619\n", "Train Epoch: 8 [26880/60000 (45%)]\tLoss: 0.022641\n", "Train Epoch: 8 [27520/60000 (46%)]\tLoss: 0.010636\n", "Train Epoch: 8 [28160/60000 (47%)]\tLoss: 0.030925\n", "Train Epoch: 8 [28800/60000 (48%)]\tLoss: 0.041090\n", "Train Epoch: 8 [29440/60000 (49%)]\tLoss: 0.184022\n", "Train Epoch: 8 [30080/60000 (50%)]\tLoss: 0.033844\n", "Train Epoch: 8 [30720/60000 (51%)]\tLoss: 0.045638\n", "Train Epoch: 8 [31360/60000 (52%)]\tLoss: 0.146449\n", "Train Epoch: 8 [32000/60000 (53%)]\tLoss: 0.037750\n", "Train Epoch: 8 [32640/60000 (54%)]\tLoss: 0.037086\n", "Train Epoch: 8 [33280/60000 (55%)]\tLoss: 0.156055\n", "Train Epoch: 8 [33920/60000 (57%)]\tLoss: 0.245971\n", "Train Epoch: 8 [34560/60000 (58%)]\tLoss: 0.034121\n", "Train Epoch: 8 [35200/60000 (59%)]\tLoss: 0.055762\n", "Train Epoch: 8 [35840/60000 (60%)]\tLoss: 0.032042\n", "Train Epoch: 8 [36480/60000 (61%)]\tLoss: 0.073726\n", "Train Epoch: 8 [37120/60000 (62%)]\tLoss: 0.062818\n", "Train Epoch: 8 [37760/60000 (63%)]\tLoss: 0.110426\n", "Train Epoch: 8 [38400/60000 (64%)]\tLoss: 0.118748\n", "Train Epoch: 8 [39040/60000 (65%)]\tLoss: 0.056931\n", "Train Epoch: 8 [39680/60000 (66%)]\tLoss: 0.079196\n", "Train Epoch: 8 [40320/60000 (67%)]\tLoss: 0.044671\n", "Train Epoch: 8 [40960/60000 (68%)]\tLoss: 0.074844\n", "Train Epoch: 8 [41600/60000 (69%)]\tLoss: 0.134735\n", "Train Epoch: 8 [42240/60000 (70%)]\tLoss: 0.041291\n", "Train Epoch: 8 [42880/60000 (71%)]\tLoss: 0.072597\n", "Train Epoch: 8 [43520/60000 (72%)]\tLoss: 0.081559\n", "Train Epoch: 8 [44160/60000 (74%)]\tLoss: 0.045724\n", "Train Epoch: 8 [44800/60000 (75%)]\tLoss: 0.062839\n", "Train Epoch: 8 [45440/60000 (76%)]\tLoss: 0.076726\n", "Train Epoch: 8 [46080/60000 (77%)]\tLoss: 0.032096\n", "Train Epoch: 8 [46720/60000 (78%)]\tLoss: 0.143978\n", "Train Epoch: 8 [47360/60000 (79%)]\tLoss: 0.012995\n", "Train Epoch: 8 [48000/60000 (80%)]\tLoss: 0.013371\n", "Train Epoch: 8 [48640/60000 (81%)]\tLoss: 0.103640\n", "Train Epoch: 8 [49280/60000 (82%)]\tLoss: 0.031259\n", "Train Epoch: 8 [49920/60000 (83%)]\tLoss: 0.048746\n", "Train Epoch: 8 [50560/60000 (84%)]\tLoss: 0.063274\n", "Train Epoch: 8 [51200/60000 (85%)]\tLoss: 0.071457\n", "Train Epoch: 8 [51840/60000 (86%)]\tLoss: 0.044408\n", "Train Epoch: 8 [52480/60000 (87%)]\tLoss: 0.194396\n", "Train Epoch: 8 [53120/60000 (88%)]\tLoss: 0.176485\n", "Train Epoch: 8 [53760/60000 (90%)]\tLoss: 0.047335\n", "Train Epoch: 8 [54400/60000 (91%)]\tLoss: 0.118688\n", "Train Epoch: 8 [55040/60000 (92%)]\tLoss: 0.045645\n", "Train Epoch: 8 [55680/60000 (93%)]\tLoss: 0.067245\n", "Train Epoch: 8 [56320/60000 (94%)]\tLoss: 0.030975\n", "Train Epoch: 8 [56960/60000 (95%)]\tLoss: 0.049449\n", "Train Epoch: 8 [57600/60000 (96%)]\tLoss: 0.022767\n", "Train Epoch: 8 [58240/60000 (97%)]\tLoss: 0.014989\n", "Train Epoch: 8 [58880/60000 (98%)]\tLoss: 0.019494\n", "Train Epoch: 8 [59520/60000 (99%)]\tLoss: 0.046725\n", "\n", "Test set: Average loss: 0.0554, Accuracy: 9816/10000 (98%)\n", "\n", "Train Epoch: 9 [0/60000 (0%)]\tLoss: 0.157581\n", "Train Epoch: 9 [640/60000 (1%)]\tLoss: 0.014102\n", "Train Epoch: 9 [1280/60000 (2%)]\tLoss: 0.050544\n", "Train Epoch: 9 [1920/60000 (3%)]\tLoss: 0.144397\n", "Train Epoch: 9 [2560/60000 (4%)]\tLoss: 0.050650\n", "Train Epoch: 9 [3200/60000 (5%)]\tLoss: 0.015721\n", "Train Epoch: 9 [3840/60000 (6%)]\tLoss: 0.063486\n", "Train Epoch: 9 [4480/60000 (7%)]\tLoss: 0.048654\n", "Train Epoch: 9 [5120/60000 (9%)]\tLoss: 0.022528\n", "Train Epoch: 9 [5760/60000 (10%)]\tLoss: 0.031864\n", "Train Epoch: 9 [6400/60000 (11%)]\tLoss: 0.064015\n", "Train Epoch: 9 [7040/60000 (12%)]\tLoss: 0.058589\n", "Train Epoch: 9 [7680/60000 (13%)]\tLoss: 0.072318\n", "Train Epoch: 9 [8320/60000 (14%)]\tLoss: 0.154009\n", "Train Epoch: 9 [8960/60000 (15%)]\tLoss: 0.035568\n", "Train Epoch: 9 [9600/60000 (16%)]\tLoss: 0.037959\n", "Train Epoch: 9 [10240/60000 (17%)]\tLoss: 0.061792\n", "Train Epoch: 9 [10880/60000 (18%)]\tLoss: 0.154225\n", "Train Epoch: 9 [11520/60000 (19%)]\tLoss: 0.042054\n", "Train Epoch: 9 [12160/60000 (20%)]\tLoss: 0.047962\n", "Train Epoch: 9 [12800/60000 (21%)]\tLoss: 0.011696\n", "Train Epoch: 9 [13440/60000 (22%)]\tLoss: 0.046374\n", "Train Epoch: 9 [14080/60000 (23%)]\tLoss: 0.017912\n", "Train Epoch: 9 [14720/60000 (25%)]\tLoss: 0.068677\n", "Train Epoch: 9 [15360/60000 (26%)]\tLoss: 0.091715\n", "Train Epoch: 9 [16000/60000 (27%)]\tLoss: 0.079036\n", "Train Epoch: 9 [16640/60000 (28%)]\tLoss: 0.081812\n", "Train Epoch: 9 [17280/60000 (29%)]\tLoss: 0.012159\n", "Train Epoch: 9 [17920/60000 (30%)]\tLoss: 0.030305\n", "Train Epoch: 9 [18560/60000 (31%)]\tLoss: 0.018032\n", "Train Epoch: 9 [19200/60000 (32%)]\tLoss: 0.079029\n", "Train Epoch: 9 [19840/60000 (33%)]\tLoss: 0.005227\n", "Train Epoch: 9 [20480/60000 (34%)]\tLoss: 0.088407\n", "Train Epoch: 9 [21120/60000 (35%)]\tLoss: 0.013704\n", "Train Epoch: 9 [21760/60000 (36%)]\tLoss: 0.162432\n", "Train Epoch: 9 [22400/60000 (37%)]\tLoss: 0.118379\n", "Train Epoch: 9 [23040/60000 (38%)]\tLoss: 0.037038\n", "Train Epoch: 9 [23680/60000 (39%)]\tLoss: 0.033017\n", "Train Epoch: 9 [24320/60000 (41%)]\tLoss: 0.045480\n", "Train Epoch: 9 [24960/60000 (42%)]\tLoss: 0.023685\n", "Train Epoch: 9 [25600/60000 (43%)]\tLoss: 0.016987\n", "Train Epoch: 9 [26240/60000 (44%)]\tLoss: 0.137735\n", "Train Epoch: 9 [26880/60000 (45%)]\tLoss: 0.006446\n", "Train Epoch: 9 [27520/60000 (46%)]\tLoss: 0.127449\n", "Train Epoch: 9 [28160/60000 (47%)]\tLoss: 0.043093\n", "Train Epoch: 9 [28800/60000 (48%)]\tLoss: 0.047350\n", "Train Epoch: 9 [29440/60000 (49%)]\tLoss: 0.006704\n", "Train Epoch: 9 [30080/60000 (50%)]\tLoss: 0.083558\n", "Train Epoch: 9 [30720/60000 (51%)]\tLoss: 0.072605\n", "Train Epoch: 9 [31360/60000 (52%)]\tLoss: 0.040057\n", "Train Epoch: 9 [32000/60000 (53%)]\tLoss: 0.064798\n", "Train Epoch: 9 [32640/60000 (54%)]\tLoss: 0.084828\n", "Train Epoch: 9 [33280/60000 (55%)]\tLoss: 0.066748\n", "Train Epoch: 9 [33920/60000 (57%)]\tLoss: 0.023121\n", "Train Epoch: 9 [34560/60000 (58%)]\tLoss: 0.041183\n", "Train Epoch: 9 [35200/60000 (59%)]\tLoss: 0.057904\n", "Train Epoch: 9 [35840/60000 (60%)]\tLoss: 0.094694\n", "Train Epoch: 9 [36480/60000 (61%)]\tLoss: 0.057253\n", "Train Epoch: 9 [37120/60000 (62%)]\tLoss: 0.029024\n", "Train Epoch: 9 [37760/60000 (63%)]\tLoss: 0.049026\n", "Train Epoch: 9 [38400/60000 (64%)]\tLoss: 0.031180\n", "Train Epoch: 9 [39040/60000 (65%)]\tLoss: 0.018087\n", "Train Epoch: 9 [39680/60000 (66%)]\tLoss: 0.121827\n", "Train Epoch: 9 [40320/60000 (67%)]\tLoss: 0.026022\n", "Train Epoch: 9 [40960/60000 (68%)]\tLoss: 0.094626\n", "Train Epoch: 9 [41600/60000 (69%)]\tLoss: 0.060430\n", "Train Epoch: 9 [42240/60000 (70%)]\tLoss: 0.027267\n", "Train Epoch: 9 [42880/60000 (71%)]\tLoss: 0.105337\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Train Epoch: 9 [43520/60000 (72%)]\tLoss: 0.029487\n", "Train Epoch: 9 [44160/60000 (74%)]\tLoss: 0.029931\n", "Train Epoch: 9 [44800/60000 (75%)]\tLoss: 0.064974\n", "Train Epoch: 9 [45440/60000 (76%)]\tLoss: 0.090586\n", "Train Epoch: 9 [46080/60000 (77%)]\tLoss: 0.092096\n", "Train Epoch: 9 [46720/60000 (78%)]\tLoss: 0.010928\n", "Train Epoch: 9 [47360/60000 (79%)]\tLoss: 0.056327\n", "Train Epoch: 9 [48000/60000 (80%)]\tLoss: 0.031470\n", "Train Epoch: 9 [48640/60000 (81%)]\tLoss: 0.062591\n", "Train Epoch: 9 [49280/60000 (82%)]\tLoss: 0.079878\n", "Train Epoch: 9 [49920/60000 (83%)]\tLoss: 0.025575\n", "Train Epoch: 9 [50560/60000 (84%)]\tLoss: 0.016678\n", "Train Epoch: 9 [51200/60000 (85%)]\tLoss: 0.036606\n", "Train Epoch: 9 [51840/60000 (86%)]\tLoss: 0.009055\n", "Train Epoch: 9 [52480/60000 (87%)]\tLoss: 0.077593\n", "Train Epoch: 9 [53120/60000 (88%)]\tLoss: 0.049766\n", "Train Epoch: 9 [53760/60000 (90%)]\tLoss: 0.029348\n", "Train Epoch: 9 [54400/60000 (91%)]\tLoss: 0.026008\n", "Train Epoch: 9 [55040/60000 (92%)]\tLoss: 0.007919\n", "Train Epoch: 9 [55680/60000 (93%)]\tLoss: 0.065004\n", "Train Epoch: 9 [56320/60000 (94%)]\tLoss: 0.020004\n", "Train Epoch: 9 [56960/60000 (95%)]\tLoss: 0.023373\n", "Train Epoch: 9 [57600/60000 (96%)]\tLoss: 0.013297\n", "Train Epoch: 9 [58240/60000 (97%)]\tLoss: 0.091797\n", "Train Epoch: 9 [58880/60000 (98%)]\tLoss: 0.027091\n", "Train Epoch: 9 [59520/60000 (99%)]\tLoss: 0.082391\n", "\n", "Test set: Average loss: 0.0504, Accuracy: 9839/10000 (98%)\n", "\n" ] } ], "source": [ "\n", "for epoch in range(1, 10):\n", " train(epoch)\n", " test()\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Finally, we copy and paste the last 5 lines of the testing result:\n", "\n", "* Train Epoch: 9 [56960/60000 (95%)]\tLoss: 0.005480\n", "* Train Epoch: 9 [57600/60000 (96%)]\tLoss: 0.103070\n", "* Train Epoch: 9 [58240/60000 (97%)]\tLoss: 0.003925\n", "* Train Epoch: 9 [58880/60000 (98%)]\tLoss: 0.018122\n", "* Train Epoch: 9 [59520/60000 (99%)]\tLoss: 0.025634\n", "\n", "*Test set: Average loss: 0.0484, Accuracy: 9849/10000 (98%)\n", "\n", "**NOTE**: The above result changes every time, but fianl Accuracy is always roughly the same." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.5" } }, "nbformat": 4, "nbformat_minor": 2 }