Added onnx export support for several multiclass classifiers#4462
Merged
harishsk merged 3 commits intodotnet:masterfrom Nov 25, 2019
harishsk:multiclassonnx
Merged
Added onnx export support for several multiclass classifiers#4462harishsk merged 3 commits intodotnet:masterfrom harishsk:multiclassonnx
harishsk merged 3 commits intodotnet:masterfrom
harishsk:multiclassonnx
Conversation
ganik
reviewed
Nov 19, 2019
| public abstract ValueMapper<VBuffer<float>, VBuffer<float>> GetMapper(); | ||
| public abstract JToken SaveAsPfa(BoundPfaContext ctx, JToken input); | ||
|
|
||
| public bool CanSaveOnnx(OnnxContext ctx) => Predictors.All(pred => (pred as ICanSaveOnnx)?.CanSaveOnnx(ctx) == true); |
Member
There was a problem hiding this comment.
(pred as ICanSaveOnnx)? [](start = 79, length = 23)
What happens if it cant cast? #Resolved
Contributor
Author
There was a problem hiding this comment.
If it can't cast, it will return a null. And the question mark after the ')' ensures makes it a null conditional operator and will not execute further and the overall function will return false.
In reply to: 348211703 [](ancestors = 348211703)
Codecov Report
@@ Coverage Diff @@
## master #4462 +/- ##
=========================================
Coverage ? 75.01%
=========================================
Files ? 908
Lines ? 160800
Branches ? 17371
=========================================
Hits ? 120629
Misses ? 35460
Partials ? 4711
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds Onnx export support + tests for the following multiclass classifiers:
There is a question marked with a REVIEW comment in the PR below. Please comment if you know of a better way to do what is done there.