Skip to content
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

Updating the ApplyOnnxModel transform to meet the API parameter ordering standards #3086

Merged
merged 1 commit into from
Mar 26, 2019

Conversation

rogancarr
Copy link
Contributor

This PR updates the ApplyOnnxModel transform to meet the API standards: Moving to outputColumnName, inputColumnName, modelFile.

Fixes #3082

/// <param name="gpuDeviceId">Optional GPU device ID to run execution on, <see langword="null" /> to run on CPU.</param>
/// <param name="fallbackToCpu">If GPU error, raise exception or fallback to CPU.</param>
public static OnnxScoringEstimator ApplyOnnxModel(this TransformsCatalog catalog,
string modelFile,
string outputColumnName,
string inputColumnName,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inputColumnName [](start = 19, length = 15)

should this default to the outputColumnName like the other inputColumns?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my comment is the same.


In reply to: 268883194 [](ancestors = 268883194)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went back and forth on this. I don't think we need to have this as an "in-place" transform because we expect models to create new columns, similar to the TensorFlow transform.

@codecov
Copy link

codecov bot commented Mar 25, 2019

Codecov Report

Merging #3086 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #3086      +/-   ##
==========================================
+ Coverage   72.52%   72.53%   +<.01%     
==========================================
  Files         807      807              
  Lines      144537   144537              
  Branches    16194    16194              
==========================================
+ Hits       104831   104839       +8     
+ Misses      35296    35291       -5     
+ Partials     4410     4407       -3
Flag Coverage Δ
#Debug 72.53% <100%> (ø) ⬆️
#production 68.14% <ø> (ø) ⬆️
#test 88.79% <100%> (ø) ⬆️
Impacted Files Coverage Δ
src/Microsoft.ML.OnnxTransformer/OnnxCatalog.cs 100% <ø> (ø) ⬆️
test/Microsoft.ML.Tests/OnnxConversionTest.cs 97.22% <100%> (ø) ⬆️
...osoft.ML.OnnxTransformerTest/OnnxTransformTests.cs 98.49% <100%> (ø) ⬆️
...ML.Transforms/Text/StopWordsRemovingTransformer.cs 86.26% <0%> (+0.15%) ⬆️
src/Microsoft.ML.Transforms/Text/LdaTransform.cs 89.89% <0%> (+0.62%) ⬆️
src/Microsoft.ML.Maml/MAML.cs 26.21% <0%> (+1.45%) ⬆️

1 similar comment
@codecov
Copy link

codecov bot commented Mar 25, 2019

Codecov Report

Merging #3086 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #3086      +/-   ##
==========================================
+ Coverage   72.52%   72.53%   +<.01%     
==========================================
  Files         807      807              
  Lines      144537   144537              
  Branches    16194    16194              
==========================================
+ Hits       104831   104839       +8     
+ Misses      35296    35291       -5     
+ Partials     4410     4407       -3
Flag Coverage Δ
#Debug 72.53% <100%> (ø) ⬆️
#production 68.14% <ø> (ø) ⬆️
#test 88.79% <100%> (ø) ⬆️
Impacted Files Coverage Δ
src/Microsoft.ML.OnnxTransformer/OnnxCatalog.cs 100% <ø> (ø) ⬆️
test/Microsoft.ML.Tests/OnnxConversionTest.cs 97.22% <100%> (ø) ⬆️
...osoft.ML.OnnxTransformerTest/OnnxTransformTests.cs 98.49% <100%> (ø) ⬆️
...ML.Transforms/Text/StopWordsRemovingTransformer.cs 86.26% <0%> (+0.15%) ⬆️
src/Microsoft.ML.Transforms/Text/LdaTransform.cs 89.89% <0%> (+0.62%) ⬆️
src/Microsoft.ML.Maml/MAML.cs 26.21% <0%> (+1.45%) ⬆️

Copy link

@shmoradims shmoradims left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@@ -34,7 +34,7 @@ public static void Example()
var mlContext = new MLContext();
var data = GetTensorData();
var idv = mlContext.Data.LoadFromEnumerable(data);
var pipeline = mlContext.Transforms.ApplyOnnxModel(modelPath, new[] { outputInfo.Key }, new[] { inputInfo.Key });
var pipeline = mlContext.Transforms.ApplyOnnxModel(new[] { outputInfo.Key }, new[] { inputInfo.Key }, modelPath);
Copy link
Contributor

@zeahmed zeahmed Mar 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modelPath [](start = 114, length = 9)

I see at line 20 where session is loaded. Does the ApplyOnnxModel reload the model? If it does then there needs to be a way to reuse the session object created above. #WontFix

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a good point. Can you file an issue on this? We can do this as we start to fix outstanding issues in the ONNX implementation.


In reply to: 268890248 [](ancestors = 268890248)

Copy link
Contributor

@zeahmed zeahmed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@rogancarr rogancarr merged commit 9caafb0 into dotnet:master Mar 26, 2019
@rogancarr rogancarr deleted the 3082_ApplyOnnxModelApiOrder branch March 26, 2019 03:50
@ghost ghost locked as resolved and limited conversation to collaborators Mar 23, 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.

4 participants