-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Reformatting TensorFlow and AnomalyDetection samples to width 85 #3922
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
Conversation
docs/samples/Microsoft.ML.Samples/Dynamic/TensorFlow/TextClassification.cs
Outdated
Show resolved
Hide resolved
docs/samples/Microsoft.ML.Samples/Dynamic/TensorFlow/TextClassification.cs
Outdated
Show resolved
Hide resolved
docs/samples/Microsoft.ML.Samples/Dynamic/TensorFlow/TextClassification.cs
Show resolved
Hide resolved
docs/samples/Microsoft.ML.Samples/Dynamic/TensorFlow/TextClassification.cs
Outdated
Show resolved
Hide resolved
...les/Microsoft.ML.Samples/Dynamic/Trainers/AnomalyDetection/RandomizedPcaSampleWithOptions.cs
Outdated
Show resolved
Hide resolved
docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/AnomalyDetection/RandomizedPcaSample.cs
Show resolved
Hide resolved
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.
Just left some minor comments. Overall LGTM.
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.
A couple of suggestions
|
||
Action<IMDBSentiment, IntermediateFeatures> ResizeFeaturesAction = (i, j) => | ||
Action<IMDBSentiment, IntermediateFeatures> ResizeFeaturesAction = (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.
This would be clearer if the (i, j) was on the same line
.Append(mlContext.Transforms.CopyColumns("Prediction", "Prediction/Softmax")) | ||
.Fit(dataView); | ||
var engine = mlContext.Model.CreatePredictionEngine<IMDBSentiment, OutputScores>(model); | ||
var model = mlContext.Transforms.Text.TokenizeIntoWords( |
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.
It would be better to try and align the Append methods, as well as keep the transform strings together. Something like:
var model =
mlContext.Transforms.Text.TokenizeIntoWords(
"TokenizedWords",
"Sentiment_Text")
.Append(mlContext.Transforms.Conversion.MapValue(
"VariableLengthFeatures",
lookupMap,
lookupMap.Schema["Words"],
lookupMap.Schema["Ids"],
"TokenizedWords"))
.Append(mlContext.Transforms.CustomMapping(
ResizeFeaturesAction,
"Resize"))
.Append(tensorFlowModel.ScoreTensorFlowModel(
"Prediction/Softmax",
"Features"))
.Append(mlContext.Transforms.CopyColumns(
"Prediction",
"Prediction/Softmax"))
.Fit(dataView);
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.
A couple of suggestions
var image1 = Enumerable.Range(0, inputSize).Select( | ||
x => (float)x / inputSize).ToArray(); | ||
var image2 = Enumerable.Range(0, inputSize).Select( | ||
x => (float)(x + 10000) / inputSize).ToArray(); |
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.
As discussed new line between any two lines that were broken into multiple lines.
…net#3922) * Testing * Reformatted TensorFlow samples to width 85 * Reformatted AnomalyDetection samples to width 85 * Fixed formatting errors * Made a few edits to TensorFlow samples format * Fixed syntax errors * Spacing changes
Guidelines followed:
Fix for Issue #3478