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

[ResNet] Add fine-tuning example #29

Merged
merged 3 commits into from
May 7, 2024
Merged

[ResNet] Add fine-tuning example #29

merged 3 commits into from
May 7, 2024

Conversation

laggui
Copy link
Member

@laggui laggui commented Apr 29, 2024

Added a fine-tuning example for multi-label classification on the Planet dataset sample. Inspired by this post when I was looking for multi-label classification datasets examples.

  • Refactored resnet-burn to have a virtual workspace and support multiple examples with different dependencies
  • Moved imagenet.rs module to the inference example since it is not a strict model requirement
  • Added simple fine-tuning example for ResNet-18 with wgpu and tch-gpu feature flags

I consistently get >92% multi-label accuracy when running the example. Training is pretty quick (even on my peasant laptop GPU w/ 6GB VRAM).

Last run:

======================== Learner Summary ========================
Model: ResNet[num_params=11194833]
Total Epochs: 5


| Split | Metric        | Min.     | Epoch    | Max.     | Epoch    |
|-------|---------------|----------|----------|----------|----------|
| Train | Loss          | 0.078    | 5        | 0.381    | 1        |
| Train | Hamming Score | 84.303   | 1        | 97.193   | 5        |
| Valid | Loss          | 0.192    | 5        | 0.412    | 1        |
| Valid | Hamming Score | 86.667   | 1        | 94.078   | 5        |

Training completed in 5m50s
Predicted: ["partly_cloudy", "primary"]
Expected: ["partly_cloudy", "primary"]

Copy link
Collaborator

@antimora antimora left a comment

Choose a reason for hiding this comment

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

LGTM

@nathanielsimard nathanielsimard merged commit f689d8e into main May 7, 2024
2 checks passed
@nathanielsimard nathanielsimard deleted the resnet/fine-tune branch May 7, 2024 12:21
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