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

[WIP] ResNet-18 #221

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

[WIP] ResNet-18 #221

wants to merge 1 commit into from

Conversation

OTapio
Copy link

@OTapio OTapio commented Apr 5, 2020

Created ResNet-18 for Flux. It does function but still needs some work. Has issues with speed and memory consumption. Feedback would be appreciated.

@DhairyaLGandhi
Copy link
Member

Might be better as a PR to Metalhead, to make it capable of emitting common Resnets The default is ResNet50, but it should be able to emit the kinds we may want.

MeanPool((7,7)),
x -> reshape(x, :, size(x,4)),
Dense(512*1, 10),
softmax,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should remove the softmax here since you are using logicrossentropy

end


loss(x, y) = sum(logitcrossentropy(m(x), y))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm not wrong, logitcrossentropy already performs reduction, no need for sum

Comment on lines +130 to +132
SkipConnection(identity_layer(512), (variable_1, variable_2) -> variable_1 + variable_2),
MeanPool((7,7)),
x -> reshape(x, :, size(x,4)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't these anonymous functions have names?

Suggested change
SkipConnection(identity_layer(512), (variable_1, variable_2) -> variable_1 + variable_2),
MeanPool((7,7)),
x -> reshape(x, :, size(x,4)),
SkipConnection(identity_layer(512), +),
MeanPool((7,7)),
Flux.flatten,

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.

4 participants