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

Transfer learning with pytorch engine on fresh fruit dataset #2070

Merged
merged 19 commits into from
Oct 28, 2022

Conversation

KexinFeng
Copy link
Contributor

@KexinFeng KexinFeng commented Oct 8, 2022

Description

In this PR, the following features are enabled:

  1. The transfer learning feature on PyTorch engine. User can opt in this feature by setting "retrain" to String "true" in Criteria.builder().optOption(String key, String value), when loading the traced pretrained model.
  2. The trainable variables(parameters) can have per variable loss function.

@KexinFeng KexinFeng changed the title Transfer Transfer learning with pytorch engine on fresh fruit dataset Oct 8, 2022
@KexinFeng KexinFeng marked this pull request as ready for review October 8, 2022 20:49
@KexinFeng KexinFeng changed the title Transfer learning with pytorch engine on fresh fruit dataset ATLearning with pytorch engine on fresh fruit dataset Oct 8, 2022
@KexinFeng KexinFeng changed the title ATLearning with pytorch engine on fresh fruit dataset Transfer learning with pytorch engine on fresh fruit dataset Oct 8, 2022
@KexinFeng KexinFeng force-pushed the transfer branch 6 times, most recently from 520fd25 to 13c65d3 Compare October 10, 2022 03:09
@KexinFeng KexinFeng force-pushed the transfer branch 3 times, most recently from cddea53 to ed0e7a6 Compare October 10, 2022 06:42
@codecov-commenter
Copy link

codecov-commenter commented Oct 10, 2022

Codecov Report

Base: 72.08% // Head: 70.33% // Decreases project coverage by -1.75% ⚠️

Coverage data is based on head (257672b) compared to base (bb5073f).
Patch coverage: 71.63% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2070      +/-   ##
============================================
- Coverage     72.08%   70.33%   -1.76%     
- Complexity     5126     6147    +1021     
============================================
  Files           473      615     +142     
  Lines         21970    27301    +5331     
  Branches       2351     2958     +607     
============================================
+ Hits          15838    19201    +3363     
- Misses         4925     6662    +1737     
- Partials       1207     1438     +231     
Impacted Files Coverage Δ
api/src/main/java/ai/djl/modality/cv/Image.java 69.23% <ø> (-4.11%) ⬇️
...rc/main/java/ai/djl/modality/cv/MultiBoxPrior.java 76.00% <ø> (ø)
...rc/main/java/ai/djl/modality/cv/output/Joints.java 71.42% <ø> (ø)
.../main/java/ai/djl/modality/cv/output/Landmark.java 100.00% <ø> (ø)
...main/java/ai/djl/modality/cv/output/Rectangle.java 72.41% <0.00%> (ø)
...i/djl/modality/cv/translator/BigGANTranslator.java 21.42% <0.00%> (-5.24%) ⬇️
.../modality/cv/translator/ImageFeatureExtractor.java 0.00% <0.00%> (ø)
.../ai/djl/modality/cv/translator/YoloTranslator.java 27.77% <0.00%> (+18.95%) ⬆️
...modality/cv/translator/wrapper/FileTranslator.java 44.44% <ø> (ø)
...y/cv/translator/wrapper/InputStreamTranslator.java 44.44% <ø> (ø)
... and 547 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@KexinFeng KexinFeng force-pushed the transfer branch 3 times, most recently from 6214148 to a13f059 Compare October 12, 2022 16:36
@KexinFeng KexinFeng requested a review from frankfliu October 22, 2022 03:01
@KexinFeng KexinFeng force-pushed the transfer branch 3 times, most recently from 074d4c8 to 2840195 Compare October 26, 2022 06:17
@KexinFeng KexinFeng force-pushed the transfer branch 2 times, most recently from 85cf476 to 77bec10 Compare October 26, 2022 07:04
KexinFeng and others added 2 commits October 26, 2022 16:45
This helps divide the simple trackers from the ones that can be per-parameter.
Maybe we can also generalize the parameter tracker to handle other cases as a
multi-tracker, but for now it should better represent the situation that is
happening with the fixedPerValueTracker.
Copy link
Contributor

@zachgk zachgk left a comment

Choose a reason for hiding this comment

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

I updated this with a new ParameterTracker abstraction which I think should make the situation more maintainable and easier to get "correct" in the future rather than forgetting to update the parameter id. With this change, I think it looks good to merge

@frankfliu frankfliu merged commit b7fce8c into deepjavalibrary:master Oct 28, 2022
patins1 pushed a commit to patins1/djl that referenced this pull request Oct 30, 2022
…alibrary#2070)

* ATLearning on PyTorch, frozen pretrained model

Co-authored-by: Frank Liu <frankfliu2000@gmail.com>
Co-authored-by: Zach Kimberg <kimbergz@amazon.com>
@KexinFeng KexinFeng deleted the transfer branch April 14, 2023 09: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.

4 participants