Skip to content

Instantly share code, notes, and snippets.

@thunderInfy
Created April 3, 2020 09:00
Show Gist options
  • Select an option

  • Save thunderInfy/1319ad4be2d4aac87e88fa69ad019493 to your computer and use it in GitHub Desktop.

Select an option

Save thunderInfy/1319ad4be2d4aac87e88fa69ad019493 to your computer and use it in GitHub Desktop.
resnet = resnet18(pretrained=False)
classifier = nn.Sequential(OrderedDict([
('fc1', nn.Linear(resnet.fc.in_features, 100)),
('added_relu1', nn.ReLU(inplace=True)),
('fc2', nn.Linear(100, 50)),
('added_relu2', nn.ReLU(inplace=True)),
('fc3', nn.Linear(50, 25))
]))
resnet.fc = classifier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment