一、LeNet-5模型设计
关于LeNet-5模型的详细描述请参考这里。本文实现如图1所示的LeNet-5模型。
图1 LeNet-5模型示意图
模型设计部分代码如下:
class LeNet5(torch.nn.Module):
def __init__(self):
super(LeNet5, self).__init__()
self.conv1 = torch.nn.Conv2d(3, 6, kernel_size=5)
self.conv2 = torch.nn.Conv2d(6, 16, kernel_size=5)
self.pooling = torch.nn.AvgPool2d(kernel_size=2,stride=2)
self.l1 = torch.nn.Linear(400, 120)
self.l2 = torch.nn.Linear(120, 84)
self.l3 = torch.nn.Linear(84, 10)
def forward(self, x):
batch_size = x.size(0)
x = self.pooling(self.conv1(x))
x = self.pooling(self.conv2(x))
x = x.view(batch_size, -1)
x = F.relu(self.l1(x))
x = F.relu(self.l2(x))
return self.l3(x)
model = LeNet5()
或者,也可以用下面这种写法设计模型,代码如下:
class LeNet5(torch.nn.Module):
def __init__(self):
super(LeNet5, self).__init__()
self.conv_unit = torch.nn.Sequential(
torch.nn.Conv2d(3, 6, kernel_size=5),
torch.nn.AvgPool2d(kernel_size=2, stride=2),
torch.nn.Conv2d(6, 16, kernel_size=5),
torch.nn.AvgPool2d(kernel_size=2),
)
self.fc_unit = torch.nn.Sequential(
torch.nn.Linear(400, 120),
torch.nn.ReLU(),
torch.nn.Linear(120, 84),
torch.nn.ReLU(),
torch.nn.Linear(84, 10)
)
def forward(self, x):
batch_size = x.size(0)
x = self.conv_unit(x)
x = x.view(batch_size, -1)
x = self.fc_unit(x)
return x
model = LeNet5()
运行结果如下:
Training for 100 epochs...
[0m 4s] Epoch 1 [9536/50000] loss = 2.27
[0m 6s] Epoch 1 [19136/50000] loss = 2.11
[0m 8s] Epoch 1 [28736/50000] loss = 1.98
[0m 10s] Epoch 1 [38336/50000] loss = 1.89
[0m 13s] Epoch 1 [47936/50000] loss = 1.79
Accuracy on test set: 37.36 %
[0m 18s] Epoch 2 [9536/50000] loss = 1.72
[0m 20s] Epoch 2 [19136/50000] loss = 1.68
[0m 22s] Epoch 2 [28736/50000] loss = 1.63
[0m 25s] Epoch 2 [38336/50000] loss = 1.61
[0m 27s] Epoch 2 [47936/50000] loss = 1.62
Accuracy on test set: 43.54 %
[0m 33s] Epoch 3 [9536/50000] loss = 1.55
[0m 35s] Epoch 3 [19136/50000] loss = 1.55
[0m 38s] Epoch 3 [28736/50000] loss = 1.52
[0m 40s] Epoch 3 [38336/50000] loss = 1.53
[0m 43s] Epoch 3 [47936/50000] loss = 1.48
Accuracy on test set: 46.42 %
[0m 48s] Epoch 4 [9536/50000] loss = 1.46
[0m 50s] Epoch 4 [19136/50000] loss = 1.46
[0m 53s] Epoch 4 [28736/50000] loss = 1.47
[0m 55s] Epoch 4 [38336/50000] loss = 1.44
[0m 58s] Epoch 4 [47936/50000] loss = 1.44
Accuracy on test set: 48.98 %
[1m 3s] Epoch 5 [9536/50000] loss = 1.40
[1m 5s] Epoch 5 [19136/50000] loss = 1.40
[1m 8s] Epoch 5 [28736/50000] loss = 1.40
[1m 10s] Epoch 5 [38336/50000] loss = 1.40
[1m 12s] Epoch 5 [47936/50000] loss = 1.41
Accuracy on test set: 49.79 %
[1m 17s] Epoch 6 [9536/50000] loss = 1.36
[1m 20s] Epoch 6 [19136/50000] loss = 1.37
[1m 22s] Epoch 6 [28736/50000] loss = 1.36
[1m 25s] Epoch 6 [38336/50000] loss = 1.36
[1m 27s] Epoch 6 [47936/50000] loss = 1.35
Accuracy on test set: 50.11 %
[1m 32s] Epoch 7 [9536/50000] loss = 1.33
[1m 34s] Epoch 7 [19136/50000] loss = 1.31
[1m 37s] Epoch 7 [28736/50000] loss = 1.33
[1m 39s] Epoch 7 [38336/50000] loss = 1.32
[1m 41s] Epoch 7 [47936/50000] loss = 1.29
Accuracy on test set: 50.79 %
[1m 46s] Epoch 8 [9536/50000] loss = 1.27
[1m 49s] Epoch 8 [19136/50000] loss = 1.29
[1m 51s] Epoch 8 [28736/50000] loss = 1.29
[1m 54s] Epoch 8 [38336/50000] loss = 1.29
[1m 56s] Epoch 8 [47936/50000] loss = 1.29
Accuracy on test set: 51.69 %
[2m 1s] Epoch 9 [9536/50000] loss = 1.26
[2m 3s] Epoch 9 [19136/50000] loss = 1.25
[2m 6s] Epoch 9 [28736/50000] loss = 1.26
[2m 8s] Epoch 9 [38336/50000] loss = 1.27
[2m 11s] Epoch 9 [47936/50000] loss = 1.25
Accuracy on test set: 52.52 %
[2m 15s] Epoch 10 [9536/50000] loss = 1.24
[2m 18s] Epoch 10 [19136/50000] loss = 1.24
[2m 20s] Epoch 10 [28736/50000] loss = 1.22
[2m 23s] Epoch 10 [38336/50000] loss = 1.21
[2m 25s] Epoch 10 [47936/50000] loss = 1.23
Accuracy on test set: 53.48 %
[2m 30s] Epoch 11 [9536/50000] loss = 1.18
[2m 32s] Epoch 11 [19136/50000] loss = 1.22
[2m 35s] Epoch 11 [28736/50000] loss = 1.21
[2m 37s] Epoch 11 [38336/50000] loss = 1.22
[2m 40s] Epoch 11 [47936/50000] loss = 1.20
Accuracy on test set: 52.89 %
[2m 44s] Epoch 12 [9536/50000] loss = 1.17
[2m 47s] Epoch 12 [19136/50000] loss = 1.18
[2m 49s] Epoch 12 [28736/50000] loss = 1.19
[2m 52s] Epoch 12 [38336/50000] loss = 1.19
[2m 54s] Epoch 12 [47936/50000] loss = 1.18
Accuracy on test set: 53.04 %
[2m 59s] Epoch 13 [9536/50000] loss = 1.15
[3m 1s] Epoch 13 [19136/50000] loss = 1.14
[3m 4s] Epoch 13 [28736/50000] loss = 1.17
[3m 6s] Epoch 13 [38336/50000] loss = 1.18
[3m 9s] Epoch 13 [47936/50000] loss = 1.17
Accuracy on test set: 54.67 %
[3m 14s] Epoch 14 [9536/50000] loss = 1.11
[3m 16s] Epoch 14 [19136/50000] loss = 1.14
[3m 18s] Epoch 14 [28736/50000] loss = 1.14
[3m 21s] Epoch 14 [38336/50000] loss = 1.15
[3m 23s] Epoch 14 [47936/50000] loss = 1.17
Accuracy on test set: 54.95 %
[3m 28s] Epoch 15 [9536/50000] loss = 1.10
[3m 30s] Epoch 15 [19136/50000] loss = 1.11
[3m 33s] Epoch 15 [28736/50000] loss = 1.13
[3m 35s] Epoch 15 [38336/50000] loss = 1.15
[3m 38s] Epoch 15 [47936/50000] loss = 1.13
Accuracy on test set: 55.21 %
[3m 44s] Epoch 16 [9536/50000] loss = 1.09
[3m 46s] Epoch 16 [19136/50000] loss = 1.11
[3m 48s] Epoch 16 [28736/50000] loss = 1.10
[3m 51s] Epoch 16 [38336/50000] loss = 1.10
[3m 53s] Epoch 16 [47936/50000] loss = 1.12
Accuracy on test set: 54.76 %
[3m 58s] Epoch 17 [9536/50000] loss = 1.05
[4m 0s] Epoch 17 [19136/50000] loss = 1.11
[4m 3s] Epoch 17 [28736/50000] loss = 1.07
[4m 5s] Epoch 17 [38336/50000] loss = 1.10
[4m 8s] Epoch 17 [47936/50000] loss = 1.10
Accuracy on test set: 54.36 %
[4m 13s] Epoch 18 [9536/50000] loss = 1.06
[4m 15s] Epoch 18 [19136/50000] loss = 1.06
[4m 18s] Epoch 18 [28736/50000] loss = 1.08
[4m 20s] Epoch 18 [38336/50000] loss = 1.07
[4m 23s] Epoch 18 [47936/50000] loss = 1.08
Accuracy on test set: 54.52 %
[4m 28s] Epoch 19 [9536/50000] loss = 1.04
[4m 30s] Epoch 19 [19136/50000] loss = 1.05
[4m 32s] Epoch 19 [28736/50000] loss = 1.05
[4m 35s] Epoch 19 [38336/50000] loss = 1.06
[4m 37s] Epoch 19 [47936/50000] loss = 1.08
Accuracy on test set: 55.28 %
[4m 42s] Epoch 20 [9536/50000] loss = 1.01
[4m 45s] Epoch 20 [19136/50000] loss = 1.04
[4m 47s] Epoch 20 [28736/50000] loss = 1.04
[4m 49s] Epoch 20 [38336/50000] loss = 1.06
[4m 52s] Epoch 20 [47936/50000] loss = 1.07
Accuracy on test set: 54.71 %
[4m 57s] Epoch 21 [9536/50000] loss = 1.00
[4m 59s] Epoch 21 [19136/50000] loss = 1.02
[5m 2s] Epoch 21 [28736/50000] loss = 1.03
[5m 4s] Epoch 21 [38336/50000] loss = 1.04
[5m 6s] Epoch 21 [47936/50000] loss = 1.05
Accuracy on test set: 54.02 %
[5m 11s] Epoch 22 [9536/50000] loss = 0.99
[5m 14s] Epoch 22 [19136/50000] loss = 1.01
[5m 16s] Epoch 22 [28736/50000] loss = 1.00
[5m 19s] Epoch 22 [38336/50000] loss = 1.04
[5m 21s] Epoch 22 [47936/50000] loss = 1.05
Accuracy on test set: 55.3 %
[5m 26s] Epoch 23 [9536/50000] loss = 0.95
[5m 28s] Epoch 23 [19136/50000] loss = 1.00
[5m 31s] Epoch 23 [28736/50000] loss = 1.01
[5m 33s] Epoch 23 [38336/50000] loss = 1.03
[5m 35s] Epoch 23 [47936/50000] loss = 1.05
Accuracy on test set: 54.85 %
[5m 40s] Epoch 24 [9536/50000] loss = 0.96
[5m 43s] Epoch 24 [19136/50000] loss = 0.98
[5m 45s] Epoch 24 [28736/50000] loss = 0.99
[5m 48s] Epoch 24 [38336/50000] loss = 1.00
[5m 50s] Epoch 24 [47936/50000] loss = 1.03
Accuracy on test set: 55.7 %
[5m 55s] Epoch 25 [9536/50000] loss = 0.95
[5m 57s] Epoch 25 [19136/50000] loss = 0.97
[6m 0s] Epoch 25 [28736/50000] loss = 1.00
[6m 2s] Epoch 25 [38336/50000] loss = 0.98
[6m 5s] Epoch 25 [47936/50000] loss = 1.01
Accuracy on test set: 54.51 %
[6m 9s] Epoch 26 [9536/50000] loss = 0.94
[6m 12s] Epoch 26 [19136/50000] loss = 0.95
[6m 14s] Epoch 26 [28736/50000] loss = 0.99
[6m 17s] Epoch 26 [38336/50000] loss = 0.99
[6m 19s] Epoch 26 [47936/50000] loss = 0.98
Accuracy on test set: 55.19 %
[6m 24s] Epoch 27 [9536/50000] loss = 0.92
[6m 26s] Epoch 27 [19136/50000] loss = 0.95
[6m 29s] Epoch 27 [28736/50000] loss = 0.97
[6m 31s] Epoch 27 [38336/50000] loss = 0.96
[6m 34s] Epoch 27 [47936/50000] loss = 0.99
Accuracy on test set: 54.4 %
[6m 38s] Epoch 28 [9536/50000] loss = 0.92
[6m 41s] Epoch 28 [19136/50000] loss = 0.93
[6m 43s] Epoch 28 [28736/50000] loss = 0.96
[6m 46s] Epoch 28 [38336/50000] loss = 0.96
[6m 48s] Epoch 28 [47936/50000] loss = 0.97
Accuracy on test set: 54.85 %
[6m 53s] Epoch 29 [9536/50000] loss = 0.92
[6m 55s] Epoch 29 [19136/50000] loss = 0.94
[6m 58s] Epoch 29 [28736/50000] loss = 0.94
[7m 0s] Epoch 29 [38336/50000] loss = 0.96
[7m 3s] Epoch 29 [47936/50000] loss = 0.96
Accuracy on test set: 54.96 %
[7m 8s] Epoch 30 [9536/50000] loss = 0.90
[7m 10s] Epoch 30 [19136/50000] loss = 0.93
[7m 12s] Epoch 30 [28736/50000] loss = 0.93
[7m 15s] Epoch 30 [38336/50000] loss = 0.93
[7m 17s] Epoch 30 [47936/50000] loss = 0.96
Accuracy on test set: 54.73 %
[7m 22s] Epoch 31 [9536/50000] loss = 0.89
[7m 24s] Epoch 31 [19136/50000] loss = 0.90
[7m 27s] Epoch 31 [28736/50000] loss = 0.90
[7m 29s] Epoch 31 [38336/50000] loss = 0.97
[7m 32s] Epoch 31 [47936/50000] loss = 0.94
Accuracy on test set: 54.42 %
[7m 37s] Epoch 32 [9536/50000] loss = 0.88
[7m 39s] Epoch 32 [19136/50000] loss = 0.90
[7m 41s] Epoch 32 [28736/50000] loss = 0.92
[7m 44s] Epoch 32 [38336/50000] loss = 0.93
[7m 46s] Epoch 32 [47936/50000] loss = 0.92
Accuracy on test set: 54.62 %
[7m 51s] Epoch 33 [9536/50000] loss = 0.87
[7m 54s] Epoch 33 [19136/50000] loss = 0.89
[7m 56s] Epoch 33 [28736/50000] loss = 0.91
[7m 58s] Epoch 33 [38336/50000] loss = 0.92
[8m 1s] Epoch 33 [47936/50000] loss = 0.93
Accuracy on test set: 54.4 %
[8m 6s] Epoch 34 [9536/50000] loss = 0.86
[8m 8s] Epoch 34 [19136/50000] loss = 0.87
[8m 11s] Epoch 34 [28736/50000] loss = 0.88
[8m 13s] Epoch 34 [38336/50000] loss = 0.92
[8m 15s] Epoch 34 [47936/50000] loss = 0.92
Accuracy on test set: 54.06 %
[8m 20s] Epoch 35 [9536/50000] loss = 0.85
[8m 23s] Epoch 35 [19136/50000] loss = 0.86
[8m 25s] Epoch 35 [28736/50000] loss = 0.89
[8m 27s] Epoch 35 [38336/50000] loss = 0.91
[8m 30s] Epoch 35 [47936/50000] loss = 0.90
Accuracy on test set: 54.01 %
[8m 35s] Epoch 36 [9536/50000] loss = 0.83
[8m 37s] Epoch 36 [19136/50000] loss = 0.87
[8m 40s] Epoch 36 [28736/50000] loss = 0.89
[8m 43s] Epoch 36 [38336/50000] loss = 0.89
[8m 45s] Epoch 36 [47936/50000] loss = 0.91
Accuracy on test set: 54.44 %
[8m 50s] Epoch 37 [9536/50000] loss = 0.83
[8m 53s] Epoch 37 [19136/50000] loss = 0.86
[8m 55s] Epoch 37 [28736/50000] loss = 0.87
[8m 57s] Epoch 37 [38336/50000] loss = 0.88
[9m 0s] Epoch 37 [47936/50000] loss = 0.89
Accuracy on test set: 54.03 %
[9m 5s] Epoch 38 [9536/50000] loss = 0.82
[9m 7s] Epoch 38 [19136/50000] loss = 0.84
[9m 9s] Epoch 38 [28736/50000] loss = 0.87
[9m 12s] Epoch 38 [38336/50000] loss = 0.87
[9m 14s] Epoch 38 [47936/50000] loss = 0.90
Accuracy on test set: 53.63 %
[9m 19s] Epoch 39 [9536/50000] loss = 0.82
[9m 22s] Epoch 39 [19136/50000] loss = 0.84
[9m 24s] Epoch 39 [28736/50000] loss = 0.84
[9m 27s] Epoch 39 [38336/50000] loss = 0.87
[9m 29s] Epoch 39 [47936/50000] loss = 0.89
Accuracy on test set: 54.37 %
[9m 35s] Epoch 40 [9536/50000] loss = 0.79
[9m 37s] Epoch 40 [19136/50000] loss = 0.83
[9m 40s] Epoch 40 [28736/50000] loss = 0.86
[9m 42s] Epoch 40 [38336/50000] loss = 0.87
[9m 45s] Epoch 40 [47936/50000] loss = 0.86
Accuracy on test set: 54.18 %
[9m 50s] Epoch 41 [9536/50000] loss = 0.80
[9m 52s] Epoch 41 [19136/50000] loss = 0.84
[9m 55s] Epoch 41 [28736/50000] loss = 0.84
[9m 57s] Epoch 41 [38336/50000] loss = 0.85
[10m 0s] Epoch 41 [47936/50000] loss = 0.86
Accuracy on test set: 54.52 %
[10m 5s] Epoch 42 [9536/50000] loss = 0.79
[10m 7s] Epoch 42 [19136/50000] loss = 0.81
[10m 10s] Epoch 42 [28736/50000] loss = 0.82
[10m 12s] Epoch 42 [38336/50000] loss = 0.86
[10m 15s] Epoch 42 [47936/50000] loss = 0.85
Accuracy on test set: 54.19 %
[10m 20s] Epoch 43 [9536/50000] loss = 0.77
[10m 22s] Epoch 43 [19136/50000] loss = 0.81
[10m 25s] Epoch 43 [28736/50000] loss = 0.83
[10m 27s] Epoch 43 [38336/50000] loss = 0.86
[10m 30s] Epoch 43 [47936/50000] loss = 0.87
Accuracy on test set: 54.28 %
[10m 35s] Epoch 44 [9536/50000] loss = 0.76
[10m 38s] Epoch 44 [19136/50000] loss = 0.81
[10m 40s] Epoch 44 [28736/50000] loss = 0.82
[10m 43s] Epoch 44 [38336/50000] loss = 0.83
[10m 45s] Epoch 44 [47936/50000] loss = 0.85
Accuracy on test set: 53.32 %
[10m 51s] Epoch 45 [9536/50000] loss = 0.76
[10m 53s] Epoch 45 [19136/50000] loss = 0.81
[10m 56s] Epoch 45 [28736/50000] loss = 0.81
[10m 59s] Epoch 45 [38336/50000] loss = 0.81
[11m 1s] Epoch 45 [47936/50000] loss = 0.85
Accuracy on test set: 53.7 %
[11m 6s] Epoch 46 [9536/50000] loss = 0.77
[11m 9s] Epoch 46 [19136/50000] loss = 0.78
[11m 11s] Epoch 46 [28736/50000] loss = 0.81
[11m 14s] Epoch 46 [38336/50000] loss = 0.83
[11m 17s] Epoch 46 [47936/50000] loss = 0.84
Accuracy on test set: 53.61 %
[11m 23s] Epoch 47 [9536/50000] loss = 0.75
[11m 27s] Epoch 47 [19136/50000] loss = 0.77
[11m 31s] Epoch 47 [28736/50000] loss = 0.79
[11m 35s] Epoch 47 [38336/50000] loss = 0.83
[11m 38s] Epoch 47 [47936/50000] loss = 0.84
Accuracy on test set: 52.71 %
[11m 44s] Epoch 48 [9536/50000] loss = 0.74
[11m 47s] Epoch 48 [19136/50000] loss = 0.78
[11m 50s] Epoch 48 [28736/50000] loss = 0.81
[11m 53s] Epoch 48 [38336/50000] loss = 0.80
[11m 56s] Epoch 48 [47936/50000] loss = 0.82
Accuracy on test set: 53.97 %
[12m 2s] Epoch 49 [9536/50000] loss = 0.75
[12m 5s] Epoch 49 [19136/50000] loss = 0.76
[12m 8s] Epoch 49 [28736/50000] loss = 0.79
[12m 11s] Epoch 49 [38336/50000] loss = 0.79
[12m 15s] Epoch 49 [47936/50000] loss = 0.81
Accuracy on test set: 52.4 %
[12m 22s] Epoch 50 [9536/50000] loss = 0.73
[12m 25s] Epoch 50 [19136/50000] loss = 0.75
[12m 29s] Epoch 50 [28736/50000] loss = 0.79
[12m 32s] Epoch 50 [38336/50000] loss = 0.79
[12m 36s] Epoch 50 [47936/50000] loss = 0.82
Accuracy on test set: 53.02 %
[12m 43s] Epoch 51 [9536/50000] loss = 0.73
[12m 46s] Epoch 51 [19136/50000] loss = 0.76
[12m 49s] Epoch 51 [28736/50000] loss = 0.76
[12m 53s] Epoch 51 [38336/50000] loss = 0.79
[12m 56s] Epoch 51 [47936/50000] loss = 0.81
Accuracy on test set: 52.89 %
[13m 3s] Epoch 52 [9536/50000] loss = 0.72
[13m 6s] Epoch 52 [19136/50000] loss = 0.77
[13m 9s] Epoch 52 [28736/50000] loss = 0.77
[13m 13s] Epoch 52 [38336/50000] loss = 0.77
[13m 16s] Epoch 52 [47936/50000] loss = 0.80
Accuracy on test set: 53.23 %
[13m 23s] Epoch 53 [9536/50000] loss = 0.70
[13m 27s] Epoch 53 [19136/50000] loss = 0.74
[13m 30s] Epoch 53 [28736/50000] loss = 0.78
[13m 34s] Epoch 53 [38336/50000] loss = 0.75
[13m 37s] Epoch 53 [47936/50000] loss = 0.81
Accuracy on test set: 52.45 %
[13m 43s] Epoch 54 [9536/50000] loss = 0.69
[13m 47s] Epoch 54 [19136/50000] loss = 0.75
[13m 50s] Epoch 54 [28736/50000] loss = 0.74
[13m 53s] Epoch 54 [38336/50000] loss = 0.78
[13m 57s] Epoch 54 [47936/50000] loss = 0.79
Accuracy on test set: 51.93 %
[14m 3s] Epoch 55 [9536/50000] loss = 0.70
[14m 6s] Epoch 55 [19136/50000] loss = 0.73
[14m 10s] Epoch 55 [28736/50000] loss = 0.75
[14m 13s] Epoch 55 [38336/50000] loss = 0.77
[14m 16s] Epoch 55 [47936/50000] loss = 0.79
Accuracy on test set: 52.59 %
[14m 24s] Epoch 56 [9536/50000] loss = 0.71
[14m 27s] Epoch 56 [19136/50000] loss = 0.72
[14m 30s] Epoch 56 [28736/50000] loss = 0.75
[14m 33s] Epoch 56 [38336/50000] loss = 0.74
[14m 37s] Epoch 56 [47936/50000] loss = 0.78
Accuracy on test set: 52.25 %
[14m 43s] Epoch 57 [9536/50000] loss = 0.68
[14m 46s] Epoch 57 [19136/50000] loss = 0.72
[14m 50s] Epoch 57 [28736/50000] loss = 0.75
[14m 53s] Epoch 57 [38336/50000] loss = 0.75
[14m 57s] Epoch 57 [47936/50000] loss = 0.78
Accuracy on test set: 52.17 %
[15m 4s] Epoch 58 [9536/50000] loss = 0.68
[15m 8s] Epoch 58 [19136/50000] loss = 0.71
[15m 12s] Epoch 58 [28736/50000] loss = 0.75
[15m 16s] Epoch 58 [38336/50000] loss = 0.76
[15m 19s] Epoch 58 [47936/50000] loss = 0.76
Accuracy on test set: 52.49 %
[15m 27s] Epoch 59 [9536/50000] loss = 0.68
[15m 30s] Epoch 59 [19136/50000] loss = 0.70
[15m 34s] Epoch 59 [28736/50000] loss = 0.74
[15m 38s] Epoch 59 [38336/50000] loss = 0.75
[15m 41s] Epoch 59 [47936/50000] loss = 0.76
Accuracy on test set: 52.65 %
[15m 48s] Epoch 60 [9536/50000] loss = 0.66
[15m 52s] Epoch 60 [19136/50000] loss = 0.72
[15m 56s] Epoch 60 [28736/50000] loss = 0.72
[15m 59s] Epoch 60 [38336/50000] loss = 0.75
[16m 2s] Epoch 60 [47936/50000] loss = 0.75
Accuracy on test set: 52.39 %
[16m 9s] Epoch 61 [9536/50000] loss = 0.66
[16m 12s] Epoch 61 [19136/50000] loss = 0.70
[16m 16s] Epoch 61 [28736/50000] loss = 0.72
[16m 19s] Epoch 61 [38336/50000] loss = 0.73
[16m 23s] Epoch 61 [47936/50000] loss = 0.76
Accuracy on test set: 52.01 %
[16m 30s] Epoch 62 [9536/50000] loss = 0.66
[16m 34s] Epoch 62 [19136/50000] loss = 0.68
[16m 37s] Epoch 62 [28736/50000] loss = 0.70
[16m 41s] Epoch 62 [38336/50000] loss = 0.75
[16m 45s] Epoch 62 [47936/50000] loss = 0.74
Accuracy on test set: 52.12 %
[16m 52s] Epoch 63 [9536/50000] loss = 0.65
[16m 55s] Epoch 63 [19136/50000] loss = 0.70
[16m 59s] Epoch 63 [28736/50000] loss = 0.70
[17m 3s] Epoch 63 [38336/50000] loss = 0.73
[17m 6s] Epoch 63 [47936/50000] loss = 0.74
Accuracy on test set: 51.6 %
[17m 13s] Epoch 64 [9536/50000] loss = 0.66
[17m 17s] Epoch 64 [19136/50000] loss = 0.67
[17m 20s] Epoch 64 [28736/50000] loss = 0.71
[17m 23s] Epoch 64 [38336/50000] loss = 0.71
[17m 27s] Epoch 64 [47936/50000] loss = 0.75
Accuracy on test set: 51.42 %
[17m 34s] Epoch 65 [9536/50000] loss = 0.65
[17m 37s] Epoch 65 [19136/50000] loss = 0.68
[17m 39s] Epoch 65 [28736/50000] loss = 0.70
[17m 42s] Epoch 65 [38336/50000] loss = 0.70
[17m 44s] Epoch 65 [47936/50000] loss = 0.73
Accuracy on test set: 50.96 %
[17m 49s] Epoch 66 [9536/50000] loss = 0.65
[17m 53s] Epoch 66 [19136/50000] loss = 0.67
[17m 57s] Epoch 66 [28736/50000] loss = 0.69
[18m 0s] Epoch 66 [38336/50000] loss = 0.71
[18m 3s] Epoch 66 [47936/50000] loss = 0.73
Accuracy on test set: 51.65 %
[18m 9s] Epoch 67 [9536/50000] loss = 0.65
[18m 12s] Epoch 67 [19136/50000] loss = 0.66
[18m 15s] Epoch 67 [28736/50000] loss = 0.68
[18m 19s] Epoch 67 [38336/50000] loss = 0.71
[18m 22s] Epoch 67 [47936/50000] loss = 0.72
Accuracy on test set: 52.01 %
[18m 29s] Epoch 68 [9536/50000] loss = 0.62
[18m 32s] Epoch 68 [19136/50000] loss = 0.64
[18m 35s] Epoch 68 [28736/50000] loss = 0.69
[18m 39s] Epoch 68 [38336/50000] loss = 0.70
[18m 42s] Epoch 68 [47936/50000] loss = 0.72
Accuracy on test set: 51.26 %
[18m 49s] Epoch 69 [9536/50000] loss = 0.60
[18m 52s] Epoch 69 [19136/50000] loss = 0.65
[18m 55s] Epoch 69 [28736/50000] loss = 0.67
[18m 59s] Epoch 69 [38336/50000] loss = 0.70
[19m 2s] Epoch 69 [47936/50000] loss = 0.70
Accuracy on test set: 51.43 %
[19m 9s] Epoch 70 [9536/50000] loss = 0.61
[19m 13s] Epoch 70 [19136/50000] loss = 0.63
[19m 16s] Epoch 70 [28736/50000] loss = 0.68
[19m 20s] Epoch 70 [38336/50000] loss = 0.71
[19m 23s] Epoch 70 [47936/50000] loss = 0.70
Accuracy on test set: 51.7 %
[19m 30s] Epoch 71 [9536/50000] loss = 0.60
[19m 33s] Epoch 71 [19136/50000] loss = 0.64
[19m 36s] Epoch 71 [28736/50000] loss = 0.67
[19m 40s] Epoch 71 [38336/50000] loss = 0.69
[19m 43s] Epoch 71 [47936/50000] loss = 0.71
Accuracy on test set: 51.17 %
[19m 49s] Epoch 72 [9536/50000] loss = 0.59
[19m 53s] Epoch 72 [19136/50000] loss = 0.64
[19m 56s] Epoch 72 [28736/50000] loss = 0.66
[19m 59s] Epoch 72 [38336/50000] loss = 0.70
[20m 3s] Epoch 72 [47936/50000] loss = 0.71
Accuracy on test set: 50.69 %
[20m 9s] Epoch 73 [9536/50000] loss = 0.60
[20m 13s] Epoch 73 [19136/50000] loss = 0.64
[20m 16s] Epoch 73 [28736/50000] loss = 0.66
[20m 19s] Epoch 73 [38336/50000] loss = 0.66
[20m 22s] Epoch 73 [47936/50000] loss = 0.70
Accuracy on test set: 51.55 %
[20m 28s] Epoch 74 [9536/50000] loss = 0.59
[20m 31s] Epoch 74 [19136/50000] loss = 0.62
[20m 34s] Epoch 74 [28736/50000] loss = 0.66
[20m 37s] Epoch 74 [38336/50000] loss = 0.67
[20m 41s] Epoch 74 [47936/50000] loss = 0.70
Accuracy on test set: 51.33 %
[20m 47s] Epoch 75 [9536/50000] loss = 0.60
[20m 50s] Epoch 75 [19136/50000] loss = 0.62
[20m 54s] Epoch 75 [28736/50000] loss = 0.66
[20m 57s] Epoch 75 [38336/50000] loss = 0.65
[21m 0s] Epoch 75 [47936/50000] loss = 0.69
Accuracy on test set: 51.15 %
[21m 6s] Epoch 76 [9536/50000] loss = 0.60
[21m 9s] Epoch 76 [19136/50000] loss = 0.61
[21m 12s] Epoch 76 [28736/50000] loss = 0.65
[21m 16s] Epoch 76 [38336/50000] loss = 0.64
[21m 19s] Epoch 76 [47936/50000] loss = 0.69
Accuracy on test set: 51.28 %
[21m 26s] Epoch 77 [9536/50000] loss = 0.58
[21m 30s] Epoch 77 [19136/50000] loss = 0.60
[21m 34s] Epoch 77 [28736/50000] loss = 0.63
[21m 38s] Epoch 77 [38336/50000] loss = 0.67
[21m 41s] Epoch 77 [47936/50000] loss = 0.68
Accuracy on test set: 51.08 %
[21m 48s] Epoch 78 [9536/50000] loss = 0.58
[21m 51s] Epoch 78 [19136/50000] loss = 0.61
[21m 54s] Epoch 78 [28736/50000] loss = 0.63
[21m 57s] Epoch 78 [38336/50000] loss = 0.65
[22m 1s] Epoch 78 [47936/50000] loss = 0.68
Accuracy on test set: 50.16 %
[22m 7s] Epoch 79 [9536/50000] loss = 0.58
[22m 11s] Epoch 79 [19136/50000] loss = 0.61
[22m 14s] Epoch 79 [28736/50000] loss = 0.63
[22m 18s] Epoch 79 [38336/50000] loss = 0.64
[22m 21s] Epoch 79 [47936/50000] loss = 0.67
Accuracy on test set: 51.25 %
[22m 28s] Epoch 80 [9536/50000] loss = 0.57
[22m 32s] Epoch 80 [19136/50000] loss = 0.59
[22m 35s] Epoch 80 [28736/50000] loss = 0.63
[22m 38s] Epoch 80 [38336/50000] loss = 0.65
[22m 41s] Epoch 80 [47936/50000] loss = 0.66
Accuracy on test set: 50.49 %
[22m 48s] Epoch 81 [9536/50000] loss = 0.57
[22m 51s] Epoch 81 [19136/50000] loss = 0.60
[22m 54s] Epoch 81 [28736/50000] loss = 0.63
[22m 57s] Epoch 81 [38336/50000] loss = 0.65
[23m 0s] Epoch 81 [47936/50000] loss = 0.65
Accuracy on test set: 51.32 %
[23m 6s] Epoch 82 [9536/50000] loss = 0.57
[23m 9s] Epoch 82 [19136/50000] loss = 0.61
[23m 12s] Epoch 82 [28736/50000] loss = 0.61
[23m 15s] Epoch 82 [38336/50000] loss = 0.64
[23m 18s] Epoch 82 [47936/50000] loss = 0.64
Accuracy on test set: 50.23 %
[23m 24s] Epoch 83 [9536/50000] loss = 0.54
[23m 27s] Epoch 83 [19136/50000] loss = 0.60
[23m 30s] Epoch 83 [28736/50000] loss = 0.60
[23m 33s] Epoch 83 [38336/50000] loss = 0.63
[23m 36s] Epoch 83 [47936/50000] loss = 0.65
Accuracy on test set: 50.51 %
[23m 42s] Epoch 84 [9536/50000] loss = 0.53
[23m 45s] Epoch 84 [19136/50000] loss = 0.57
[23m 48s] Epoch 84 [28736/50000] loss = 0.62
[23m 51s] Epoch 84 [38336/50000] loss = 0.63
[23m 54s] Epoch 84 [47936/50000] loss = 0.66
Accuracy on test set: 51.05 %
[24m 0s] Epoch 85 [9536/50000] loss = 0.54
[24m 3s] Epoch 85 [19136/50000] loss = 0.60
[24m 6s] Epoch 85 [28736/50000] loss = 0.60
[24m 9s] Epoch 85 [38336/50000] loss = 0.62
[24m 12s] Epoch 85 [47936/50000] loss = 0.64
Accuracy on test set: 50.21 %
[24m 17s] Epoch 86 [9536/50000] loss = 0.54
[24m 20s] Epoch 86 [19136/50000] loss = 0.58
[24m 22s] Epoch 86 [28736/50000] loss = 0.59
[24m 25s] Epoch 86 [38336/50000] loss = 0.63
[24m 27s] Epoch 86 [47936/50000] loss = 0.62
Accuracy on test set: 50.03 %
[24m 33s] Epoch 87 [9536/50000] loss = 0.56
[24m 35s] Epoch 87 [19136/50000] loss = 0.57
[24m 38s] Epoch 87 [28736/50000] loss = 0.59
[24m 41s] Epoch 87 [38336/50000] loss = 0.62
[24m 44s] Epoch 87 [47936/50000] loss = 0.65
Accuracy on test set: 49.98 %
[24m 50s] Epoch 88 [9536/50000] loss = 0.54
[24m 53s] Epoch 88 [19136/50000] loss = 0.57
[24m 56s] Epoch 88 [28736/50000] loss = 0.58
[24m 58s] Epoch 88 [38336/50000] loss = 0.61
[25m 1s] Epoch 88 [47936/50000] loss = 0.65
Accuracy on test set: 50.71 %
[25m 7s] Epoch 89 [9536/50000] loss = 0.53
[25m 10s] Epoch 89 [19136/50000] loss = 0.56
[25m 13s] Epoch 89 [28736/50000] loss = 0.59
[25m 16s] Epoch 89 [38336/50000] loss = 0.61
[25m 19s] Epoch 89 [47936/50000] loss = 0.63
Accuracy on test set: 50.16 %
[25m 25s] Epoch 90 [9536/50000] loss = 0.53
[25m 28s] Epoch 90 [19136/50000] loss = 0.55
[25m 31s] Epoch 90 [28736/50000] loss = 0.59
[25m 34s] Epoch 90 [38336/50000] loss = 0.61
[25m 37s] Epoch 90 [47936/50000] loss = 0.63
Accuracy on test set: 50.01 %
[25m 43s] Epoch 91 [9536/50000] loss = 0.53
[25m 46s] Epoch 91 [19136/50000] loss = 0.55
[25m 48s] Epoch 91 [28736/50000] loss = 0.58
[25m 52s] Epoch 91 [38336/50000] loss = 0.63
[25m 55s] Epoch 91 [47936/50000] loss = 0.63
Accuracy on test set: 50.91 %
[26m 2s] Epoch 92 [9536/50000] loss = 0.52
[26m 5s] Epoch 92 [19136/50000] loss = 0.56
[26m 8s] Epoch 92 [28736/50000] loss = 0.58
[26m 11s] Epoch 92 [38336/50000] loss = 0.63
[26m 14s] Epoch 92 [47936/50000] loss = 0.61
Accuracy on test set: 50.97 %
[26m 21s] Epoch 93 [9536/50000] loss = 0.53
[26m 24s] Epoch 93 [19136/50000] loss = 0.53
[26m 27s] Epoch 93 [28736/50000] loss = 0.58
[26m 30s] Epoch 93 [38336/50000] loss = 0.59
[26m 33s] Epoch 93 [47936/50000] loss = 0.63
Accuracy on test set: 50.62 %
[26m 39s] Epoch 94 [9536/50000] loss = 0.51
[26m 42s] Epoch 94 [19136/50000] loss = 0.53
[26m 45s] Epoch 94 [28736/50000] loss = 0.58
[26m 48s] Epoch 94 [38336/50000] loss = 0.59
[26m 51s] Epoch 94 [47936/50000] loss = 0.61
Accuracy on test set: 50.87 %
[26m 57s] Epoch 95 [9536/50000] loss = 0.51
[27m 0s] Epoch 95 [19136/50000] loss = 0.54
[27m 3s] Epoch 95 [28736/50000] loss = 0.57
[27m 6s] Epoch 95 [38336/50000] loss = 0.58
[27m 10s] Epoch 95 [47936/50000] loss = 0.59
Accuracy on test set: 50.42 %
[27m 15s] Epoch 96 [9536/50000] loss = 0.50
[27m 18s] Epoch 96 [19136/50000] loss = 0.55
[27m 21s] Epoch 96 [28736/50000] loss = 0.57
[27m 24s] Epoch 96 [38336/50000] loss = 0.58
[27m 27s] Epoch 96 [47936/50000] loss = 0.61
Accuracy on test set: 50.54 %
[27m 33s] Epoch 97 [9536/50000] loss = 0.50
[27m 36s] Epoch 97 [19136/50000] loss = 0.54
[27m 39s] Epoch 97 [28736/50000] loss = 0.56
[27m 42s] Epoch 97 [38336/50000] loss = 0.58
[27m 45s] Epoch 97 [47936/50000] loss = 0.60
Accuracy on test set: 50.18 %
[27m 51s] Epoch 98 [9536/50000] loss = 0.50
[27m 54s] Epoch 98 [19136/50000] loss = 0.54
[27m 57s] Epoch 98 [28736/50000] loss = 0.56
[28m 0s] Epoch 98 [38336/50000] loss = 0.58
[28m 3s] Epoch 98 [47936/50000] loss = 0.61
Accuracy on test set: 49.93 %
[28m 9s] Epoch 99 [9536/50000] loss = 0.49
[28m 12s] Epoch 99 [19136/50000] loss = 0.53
[28m 14s] Epoch 99 [28736/50000] loss = 0.53
[28m 17s] Epoch 99 [38336/50000] loss = 0.59
[28m 21s] Epoch 99 [47936/50000] loss = 0.60
Accuracy on test set: 49.81 %
[28m 27s] Epoch 100 [9536/50000] loss = 0.50
[28m 30s] Epoch 100 [19136/50000] loss = 0.53
[28m 33s] Epoch 100 [28736/50000] loss = 0.57
[28m 36s] Epoch 100 [38336/50000] loss = 0.58
[28m 39s] Epoch 100 [47936/50000] loss = 0.59
Accuracy on test set: 49.63 %
二、参考文献
[1] Y. Lecun, L. Bottou, Y. Bengio and P. Haffner. Gradient-based learning applied to document recognition[C]. in Proceedings of the IEEE, vol. 86, no. 11, pp. 2278-2324, Nov. 1998.
|