Skip to content

Additional changes to ExpressionTransformer #4614

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

Merged
merged 1 commit into from
Jan 7, 2020

Conversation

yaeldekel
Copy link

This PR addresses the ExpressionTransformer part of issue #4610 and also addresses some left over comments from PR #4548 .

@yaeldekel yaeldekel requested a review from a team as a code owner January 1, 2020 11:45
Copy link
Contributor

@justinormont justinormont left a comment

Choose a reason for hiding this comment

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

LGTM, I linked the code fixes to the original comments; mainly to help me understand what comments were being addressed.

The addressed parts look good.

I see these comments remaining in the original PR:

| ​long | ​convert to <xref:System.Int64> | The input may be of any type. |
| ​single, float | ​convert to <xref:System.Single> | ​The input may be of any type. |
| ​double | ​convert to <xref:System.Double> | ​​The input may be of any type. |
| ​text | ​convert to [text](xref:Microsoft.ML.Data.TextDataViewType) | ​​​The input may be of any type. This produces a default text representation. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Addresses: #4548 (comment)

#Resolved


// Since the abs of the base is at least two, the exponent must be less than 31.
if (b >= 31)
throw Contracts.Except("Cannot raise an integer to a power greater than 30");
return neg ? I4.MinValue : I4.MaxValue;
Copy link
Contributor

Choose a reason for hiding this comment

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

Addresses: #4548 (comment)

#Resolved

Param,
Auto,

// REVIEW: These are specific to the ExprTransform parser. Use a general mechanism.
Copy link
Contributor

Choose a reason for hiding this comment

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

Addresses: #4548 (comment)

#Resolved

/// [!code-csharp[Expression](~/../docs/samples/docs/samples/Microsoft.ML.Samples/Dynamic/Transforms/Expression.cs)]
/// ]]>
/// </format>
/// </example>
Copy link
Contributor

Choose a reason for hiding this comment

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

Addresses: #4548 (comment)

#Resolved

@yaeldekel
Copy link
Author

Thanks for the quick review!
Regarding vector column handling - this is mentioned in the .cs file (see line 47 in ExpressionTransformer.cs).
Regarding ONNX - I think it would be a fair amount of work, but definitely doable. I've opened issue #4615 to track this.


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

@codecov
Copy link

codecov bot commented Jan 1, 2020

Codecov Report

Merging #4614 into master will increase coverage by 0.76%.
The diff coverage is 57.14%.

@@            Coverage Diff             @@
##           master    #4614      +/-   ##
==========================================
+ Coverage   74.88%   75.64%   +0.76%     
==========================================
  Files         935      938       +3     
  Lines      168440   168623     +183     
  Branches    18189    18213      +24     
==========================================
+ Hits       126132   127562    +1430     
+ Misses      37325    36025    -1300     
- Partials     4983     5036      +53
Flag Coverage Δ
#Debug 75.64% <57.14%> (+0.76%) ⬆️
#production 71.27% <57.14%> (+1%) ⬆️
#test 90.43% <ø> (ø) ⬆️
Impacted Files Coverage Δ
src/Microsoft.ML.Transforms/Expression/TokKind.cs 32.25% <ø> (ø) ⬆️
src/Microsoft.ML.Transforms/ExpressionCatalog.cs 100% <ø> (ø) ⬆️
...c/Microsoft.ML.Transforms/ExpressionTransformer.cs 96.07% <ø> (ø) ⬆️
...osoft.ML.Transforms/Expression/BuiltinFunctions.cs 87.87% <57.14%> (ø) ⬆️
....ML.AutoML/PipelineSuggesters/PipelineSuggester.cs 79.83% <0%> (-6.73%) ⬇️
src/Microsoft.ML.AutoML/Sweepers/Parameters.cs 84.32% <0%> (-0.85%) ⬇️
...ML.Transforms/Text/StopWordsRemovingTransformer.cs 86.1% <0%> (-0.16%) ⬇️
....Experimental/OneToOneTransformerBaseExtensions.cs 100% <0%> (ø)
...c/Microsoft.ML.Experimental/MLContextExtensions.cs 0% <0%> (ø)
...c/Microsoft.ML.SamplesUtils/SamplesDatasetUtils.cs 39.77% <0%> (ø)
... and 21 more

Norm,
FloatsFromBytes,
Param,
Auto,
Copy link
Member

Choose a reason for hiding this comment

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

Why these are removed?

Copy link
Contributor

Choose a reason for hiding this comment

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

See: #4548 (comment)
These are used for the internal NN language, Net#. If we are no longer supporting that internally, then they are no longer needed. I don't think this PR provides the code for those functions, like convolution.

We may want to check that abs(a), min(a, b), max(a,b ), sqrt(a) still work.

@yaeldekel yaeldekel merged commit 354798d into dotnet:master Jan 7, 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.

4 participants