Skip to content
New issue

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

Feat 478 efficientnet and refactor cnn_architectures #620

Merged
merged 6 commits into from
Jan 2, 2023

Conversation

sammlapp
Copy link
Collaborator

Resolves #478 by adding EfficientNet to cnn_architectures. Also refactors cnn_architectures to consistently re-use weights when possible when reshaping the input conv2d layer of a model and consistently re-shape a final fully connected layer using helper functions.

Note new behavior for reshaping first conv2d layer's number of channels

  • if new # channels less than original, each channel gets weights averaged across all the original channels
  • if new # channels is more than the original, each individual original channel is copied 1 or more times until all new channels have weights from one of the original channels
  • inception architecture will have random weights if number of input channels changes from 3

created helper functions for reshaping # input channels into a Conv2d and # output nodes of a Linear (fully connected) layer. Refactored architecture definitions
torch.hub apparently expects argument pretrained=Bool
Also, avoid downloading pre-trained weights in tests
torch.hub downloads cause 403 error on Github workflows. Trying the workaround suggested here: pytorch/pytorch#61755 (comment)
@sammlapp sammlapp merged commit 6be6dfd into develop Jan 2, 2023
@sammlapp sammlapp deleted the feat_478_efficientnet branch January 2, 2023 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant