-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Make ImageClassification API an ITrainerEstimator and refactor code. #4372
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4372 +/- ##
==========================================
+ Coverage 74.63% 74.64% +<.01%
==========================================
Files 883 883
Lines 155117 155036 -81
Branches 16931 16911 -20
==========================================
- Hits 115768 115723 -45
+ Misses 34601 34569 -32
+ Partials 4748 4744 -4
|
…to imgclassificationtrainerest
src/Microsoft.ML.Dnn/DnnCatalog.cs
Outdated
PredictedLabelColumnName = predictedLabelColumnName, | ||
ValidationSet = validationSet | ||
}; | ||
options.EarlyStoppingCriteria = options.DisableEarlyStopping ? null : options.EarlyStoppingCriteria ?? new ImageClassificationTrainer.EarlyStopping(); |
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.
I made a comment on the previous PR that you said you would address in this PR.
#4362 (comment) #Closed
string featureColumnName = DefaultColumnNames.Features, | ||
string scoreColumnName = DefaultColumnNames.Score, | ||
string predictedLabelColumnName = DefaultColumnNames.PredictedLabel, | ||
IDataView validationSet = null) |
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.
I thought you were going to move the validationSet
to be during the Fit
method? #Resolved
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.
I have and it works well when the trainer is the last item in the pipeline but if it is not then the pipeline becomes nasty and you will need to save the model twice. Most people would want to add KeyToValue Transform after this trainer to convert predictedLabel to string type for example .
In reply to: 338737502 [](ancestors = 338737502)
Do we need a new delegate here? Or can we instead use Refers to: src/Microsoft.ML.Dnn/ImageClassificationTransform.cs:124 in 9a01968. [](commit_id = 9a01968, deletion_comment = False) |
…to imgclassificationtrainerest
see my previous comment. We have an api for Fit that takes both train and validation set. In reply to: 546056311 [](ancestors = 546056311) Refers to: src/Microsoft.ML.Dnn/ImageClassificationTransform.cs:426 in 9a01968. [](commit_id = 9a01968, deletion_comment = False) |
I think this should be changed to pass the The way we have it today, we are holding this extra Refers to: src/Microsoft.ML.Dnn/ImageClassificationTransform.cs:1427 in 72e0eee. [](commit_id = 72e0eee, deletion_comment = False) |
…to imgclassificationtrainerest
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.
LGTM
…otnet#4372) * Make ImageClassification API an ITrainerEstimator and refactor code. * comments. * comments. * Fix premature session close. * PR feedback. * PR feedback. * PR feedback. * PR feedback. * PR feedback. * PR feedback. * PR feedback. * PR feedback. * PR feedback.
In addition to converting ImageClassification API to ITrainerEstimator it also fixes #4276