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.
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.
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.