-
Notifications
You must be signed in to change notification settings - Fork 150
rebuild resnet using blocks #156
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks awesome! I'll let @jekbradbury review as well, but thank you very much.
Couple quick thoughts:
- How does the compile time of swift-models change with the new version of ResNet? :-D
- To simplify things a bit, could you make
imageSizeoptional (either in this PR or a follow-on PR)? ResNet is fully convolutional and works with multiple image sizes without changing the model. Having "imageSize" be a required parameter (and a single scalar instead of a(height, width)tuple) might imply to people that the ResNet implementation only works for a single (square) image size. (Thus discouraging folks from using techniques like progressive resizing.) - In a follow-up PR, let's discuss making the ResNet implementation public so that folks can (in their own Swift projects or notebooks) import the canonical ResNet and use it themselves.
Thank you again. This is super awesome to see.
All the best,
-Brennan
|
re 1) Not sure if this is just my system (running semi-current tf-swift master), but the existing version in models repo takes 43 seconds to compile here. Using this code takes ~3-4 seconds to compile. Let me know! |
This is expected because the compiler is bugged. The implementation detail is that we've turned off a part of the Swift compiler that optimizes large structures in order to suppress other bugs. We are actively working on this and expect this to be fixed within a week or two. |
This would be a good change. The reason |
|
I can work on coming up with a way to add an input type to specify cifar, imagenet and generic variants. In the same vein, can come back to refactoring things more down the road. |
56371e4 to
6ed2af6
Compare
ResNet/ResNet.swift
Outdated
| case resNet152 | ||
| } | ||
|
|
||
| init(kind: Kind, type: InputKind) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If kind conflicts with the first argument label, you can call it inputKind:. Relatedly, would DataKind be a better name for the type? If so, dataKind: would be a good label name. Same for other initializers that take DataKind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to: inputKind: Kind, dataKind: DataKind, let me know what you think!
No description provided.