有没有什么预训练的lenet模型
我目前代码如下
class LeNet(nn.Module):
def __init__(self):
super().__init__()
# 3 input image channel, 6 output channels, 5x5 square convolution
self.conv1 = torch.nn.Conv2d(3, 6, kernel_size = 5, padding = 2)
self.conv2 = torch.nn.Conv2d(6, 16, kernel_size = 5)
self.conv3 = torch.nn.Conv2d(16, 32, kernel_size = 5)
self.pool = nn.MaxPool2d(kernel_size = 2, stride = 2)
self.dropout = nn.Dropout(p=0.1)
self.fc1 = torch.nn.Linear(32*13*13, 120)
self.fc2 = torch.nn.Linear(120, 84)
self.fc3 = torch.nn.Linear(84, 2)
def forward(self, x):
x = self.pool(F.relu(self.conv1(x)))
x = self.pool(F.relu(self.conv2(x)))
x = self.pool(F.relu(self.conv3(x)))
x = torch.reshape(x, (x.size()[0], -1))
x = self.dropout(x)
x = F.relu(self.fc1(x))
x = self.dropout(x)
x = F.relu(self.fc2(x))
x = self.fc3(x)
return x
优化使用的是SGD
不知道有没有什么简单清晰的方法提高正确率
目前是91左右,希望能上93
补充:训练集不大 只有5w张图