Skip to content

Conversation

@kere-nel
Copy link
Contributor

No description provided.

@kere-nel kere-nel requested a review from a team as a code owner December 14, 2019 00:16
@kere-nel kere-nel requested a review from harishsk December 14, 2019 00:17
@codecov
Copy link

codecov bot commented Dec 14, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@fa75f4f). Click here to learn what that means.
The diff coverage is 97.01%.

@@            Coverage Diff            @@
##             master    #4577   +/-   ##
=========================================
  Coverage          ?   75.13%           
=========================================
  Files             ?      909           
  Lines             ?   160334           
  Branches          ?    17267           
=========================================
  Hits              ?   120466           
  Misses            ?    35050           
  Partials          ?     4818
Flag Coverage Δ
#Debug 75.13% <97.01%> (?)
#production 70.53% <95%> (?)
#test 90.3% <100%> (?)
Impacted Files Coverage Δ
test/Microsoft.ML.Tests/OnnxConversionTest.cs 95.66% <100%> (ø)
src/Microsoft.ML.Mkl.Components/VectorWhitening.cs 81.76% <95%> (ø)

if (rank != dimension)
{
float[] principalComponents = new float[rank * dimension];
for (int i = 0; i < parameters.Rank; i++)

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)?

Copy link
Contributor Author

@kere-nel kere-nel Dec 16, 2019

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?

@kere-nel
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@kere-nel kere-nel merged commit 2267f8d into dotnet:master Jan 23, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Mar 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants