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

Add feature-extraction AlexNet #363

Merged
merged 15 commits into from May 13, 2020

Conversation

SurajK7
Copy link
Contributor

@SurajK7 SurajK7 commented Apr 20, 2020

For now, I have used lists for data-loading so the implementation is slow and not memory efficient(~19 GB footprint).
The model achieves ~80% training accuracy after 5000 iterations but validation accuracy seems rather dismal, I will try to figure what's going wrong.
Meanwhile, any suggestions or feedback would be greatly appreciated!

@SurajK7
Copy link
Contributor Author

SurajK7 commented Apr 30, 2020

Everything seems to work fine now. I trained the final layer for 5 epochs and achieved an accuracy of ~70% on the test set which is good enough for a fine-grained classification dataset such as ours.

@SurajK7 SurajK7 marked this pull request as ready for review April 30, 2020 10:09
@junjihashimoto
Copy link
Member

Awesome!

@junjihashimoto
Copy link
Member

I feel a little strange.
Before this pr, alexnet-examples loaded pre-existing weight including top-layer.
This pr loads pre-existing weight except for top-layer, and trains the weight of top-layer to learn new features.
So previous example's use-case is different from this one.

@SurajK7
Copy link
Contributor Author

SurajK7 commented May 5, 2020

The previous example was just to showcase the loading of pretrained parameters and could be used to run inference on images as per ImageNet categories. This example feature-extracts AlexNet for non-trivial data-sets. So as such, there was no use-case of the previous example.

@SurajK7
Copy link
Contributor Author

SurajK7 commented May 5, 2020

I wrote a PyTorch like dataset-abstraction for better loading of data but I doubt that would be of any use now.

@junjihashimoto
Copy link
Member

I don't care about the dataload abstraction in this example.
So it's ok.

@junjihashimoto junjihashimoto self-requested a review May 5, 2020 14:58
@austinvhuang
Copy link
Member

austinvhuang commented May 10, 2020

Thanks for this contribution @SurajK7 . Just two minor requests, would like to merge this:

  1. Add the gist code snippets in the directory. Makes it easier to reproduce end-to-end and gets rid of an unneeded dependency on a gist.

  2. Move the google docs artifact someplace that's more intended for artifacts, could even be a github release artifact in your own repo (or we can move it to a release here if that works better) as @junjihashimoto suggested

Optional but would be nice - is there no way to avoid having to use both C++ and Python handle the serialization stuff? Would be nice if it could just be one Python script.

@SurajK7
Copy link
Contributor Author

SurajK7 commented May 12, 2020

I think it would be better if we could move the extracted parameters here.
Also, I don't think a single python script would suffice.

@austinvhuang
Copy link
Member

Thanks for adding the code @SurajK7 .

Move the serialized data artifact you mean? We're trying to keep artifacts/binaries out of the repo if at all possible.

@austinvhuang
Copy link
Member

@SurajK7 also I think if you merge master into your branch that might clear the last CI issue you have.

@SurajK7
Copy link
Contributor Author

SurajK7 commented May 12, 2020

or we can move it to a release here if that works better

@austinvhuang, I meant we can go ahead with the quoted suggestion.

@austinvhuang
Copy link
Member

@SurajK7 - I created a release for the artifact in this repo - https://github.com/hasktorch/hasktorch-artifacts/releases/tag/alexnet

See if it works to use this link instead https://github.com/hasktorch/hasktorch-artifacts/releases/download/alexnet/alexNet.pt

@austinvhuang
Copy link
Member

Thanks!

@austinvhuang austinvhuang merged commit 05bd0f5 into hasktorch:master May 13, 2020
@SurajK7 SurajK7 deleted the feature-extraction branch May 13, 2020 12:12
@junjihashimoto
Copy link
Member

@austinvhuang
Thanks for supporting this pr.
@SurajK7
Thanks!

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

3 participants