-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Added onnx export support for VectorWhitening #4577
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4577 +/- ##
=========================================
Coverage ? 75.13%
=========================================
Files ? 909
Lines ? 160334
Branches ? 17267
=========================================
Hits ? 120466
Misses ? 35050
Partials ? 4818
|
if (rank != dimension) | ||
{ | ||
float[] principalComponents = new float[rank * dimension]; | ||
for (int i = 0; i < parameters.Rank; i++) |
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.
for (int i = 0; i < parameters.Rank; i++) [](start = 20, length = 41)
If I understand correctly, this loop copies the first rank*dimension
elements from model
to principalComponents
in the same order. Do we really need to copy?
I noticed that ctx.AddInitializer
takes an IEnumerable
, perhaps it would be enough to call it with model.Take(rank*dimension)
?
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 think the problem with Take is that when the rank is higher than the dimension, ML.NET simply treats the extra eigenvectors as rows of zeros. For ONNX, the model tensor has to be resized. I can introduce a check for both ML.NET and ONNX to check that the rank <= dimension?
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
No description provided.