We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
# 首先定义一个LeNet网络 class Net(nn.Module): def __init__(self): super(Net, self).__init__() self.features = nn.Sequential( nn.Conv2d(3, 6, 5), nn.ReLU(), nn.MaxPool2d(2,2), nn.Conv2d(6, 16, 5), nn.ReLU(), nn.MaxPool2d(2,2) ) self.classifier = nn.Sequential( nn.Linear(16 * 5 * 5, 120), nn.ReLU(), nn.Linear(120, 84), nn.ReLU(), nn.Linear(84, 10) ) def forward(self, x): x = self.features(x) x = x.view(-1, 16 * 5 * 5) x = self.classifier(x) return x net = Net()
# 只为两个全连接层设置较大的学习率,其余层的学习率较小 special_layers = nn.ModuleList([net.classifier[0], net.classifier[3]])
The text was updated successfully, but these errors were encountered:
多谢指正,该错误已修复, fixed by #76
Sorry, something went wrong.
No branches or pull requests
net.classifier[3] 对应的是ReLu,不是全连接层,应该是net.classifier[2]或者net.classifier[4]
The text was updated successfully, but these errors were encountered: