Skip to content

Instantly share code, notes, and snippets.

@thunderInfy
Created August 6, 2020 21:52
Show Gist options
  • Select an option

  • Save thunderInfy/6bed54cac3e64ef70faff17743bfdc3a to your computer and use it in GitHub Desktop.

Select an option

Save thunderInfy/6bed54cac3e64ef70faff17743bfdc3a to your computer and use it in GitHub Desktop.
# defining our deep learning architecture
resnetq = resnet18(pretrained=False)
classifier = nn.Sequential(OrderedDict([
('fc1', nn.Linear(resnetq.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))
]))
resnetq.fc = classifier
resnetk = copy.deepcopy(resnetq)
# moving the resnet architecture to device
resnetq.to(device)
resnetk.to(device)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment