Skip to content

Image Classification Sample cleanup #4380

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 12 commits into from
Nov 7, 2019
Merged

Conversation

ashbhandare
Copy link
Contributor

Make samples more readable and add comments.

@codecov
Copy link

codecov bot commented Oct 24, 2019

Codecov Report

Merging #4380 into master will decrease coverage by 15.4%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           master    #4380       +/-   ##
===========================================
- Coverage   90.11%    74.7%   -15.41%     
===========================================
  Files         200      906      +706     
  Lines       36848   159288   +122440     
  Branches     1910    17145    +15235     
===========================================
+ Hits        33206   119002    +85796     
- Misses       3337    35476    +32139     
- Partials      305     4810     +4505
Flag Coverage Δ
#Debug 74.7% <ø> (-15.41%) ⬇️
#production 70.07% <ø> (?)
#test 90.11% <ø> (ø) ⬆️
Impacted Files Coverage Δ
src/Microsoft.ML.Data/Model/Pfa/ModelUtils.cs 0% <0%> (ø)
...ML.Data/Transforms/ColumnConcatenatingEstimator.cs 83.58% <0%> (ø)
src/Microsoft.ML.Data/Model/Pfa/PfaUtils.cs 0% <0%> (ø)
...t.ML.Data/DataLoadSave/CompositeLoaderEstimator.cs 80% <0%> (ø)
...t.ML.Data/DataLoadSave/Text/LoadColumnAttribute.cs 100% <0%> (ø)
...ft.ML.Data/DataLoadSave/Database/DatabaseLoader.cs 52.66% <0%> (ø)
src/Microsoft.ML.Core/Data/ModelSaveContext.cs 91.57% <0%> (ø)
...er/Multiclass/EnsembleMulticlassModelParameters.cs 84.4% <0%> (ø)
...crosoft.ML.Transforms/EntryPoints/TextAnalytics.cs 41.25% <0%> (ø)
...Microsoft.ML.Data/Transforms/NormalizeColumnDbl.cs 66.3% <0%> (ø)
... and 696 more

@ashbhandare ashbhandare marked this pull request as ready for review October 25, 2019 22:30
@ashbhandare ashbhandare requested a review from a team as a code owner October 25, 2019 22:30
string imagesDownloadFolderPath = Path.Combine(assetsPath, "inputs",
"images");

// Download Cifar Dataset.
// Download Cifar Dataset and set train and test dataset
// paths
Copy link
Member

@codemzs codemzs Oct 25, 2019

Choose a reason for hiding this comment

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

period #Resolved

// Cross-Entropy: 0.03978536
// Phase: Training, Dataset used: Validation, Batch Processed Count: 3,
// Epoch: 19, Accuracy: 0.852381
// We see that the training stops when the metric stops improving.
Copy link
Member

@codemzs codemzs Oct 25, 2019

Choose a reason for hiding this comment

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

Thanks, @[email protected] ! In this case where limiting the output to 85 characters actually makes it difficult to read sample output it is ok to cross 85 character. Otherwise your change looks very good, please fix similar stuff else where. #Resolved

// Learning Rate: 0.01 Epoch: 49, Accuracy: 1,
// Cross-Entropy: 0.01758162
// Phase: Training, Dataset used: Validation, Batch Processed Count: 3,
// Epoch: 49, Accuracy: 0.8666666
Copy link
Member

@codemzs codemzs Oct 25, 2019

Choose a reason for hiding this comment

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

please fix #Resolved

// Phase: Training, Dataset used: Train, Batch Processed Count: 18,
// Learning Rate: 0.01 Epoch: 0, Accuracy: 0.9166667,
// Cross-Entropy: 0.4866541
// ...
Copy link
Member

@codemzs codemzs Oct 25, 2019

Choose a reason for hiding this comment

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

please fix #Resolved

@ashbhandare ashbhandare force-pushed the SampleCleanup branch 2 times, most recently from 25c17f6 to 7a2c421 Compare October 28, 2019 17:06
"pre-trained model/architecture ***");

// Measuring training time.
var watch = System.Diagnostics.Stopwatch.StartNew();
Copy link
Contributor Author

@ashbhandare ashbhandare Nov 7, 2019

Choose a reason for hiding this comment

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

var watch = System.Diagnostics.Stopwatch.StartNew(); [](start = 12, length = 52)

remove measuring time in samples #Resolved

// the same transforms as above.
IEnumerable<ImageData> test_images = LoadImagesFromDirectory(
folder: fullImagesetFolderPathTest, useFolderNameAsLabel: true);
IDataView testDataset = mlContext.Data.
Copy link
Contributor Author

@ashbhandare ashbhandare Nov 7, 2019

Choose a reason for hiding this comment

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

IDataView testDataset = mlContext.Data. [](start = 12, length = 39)

new line #Resolved

folder: fullImagesetFolderPathTest, useFolderNameAsLabel: true);
IDataView testDataset = mlContext.Data.
LoadFromEnumerable(test_images);
testDataset = mlContext.Transforms.Conversion
Copy link
Contributor Author

@ashbhandare ashbhandare Nov 7, 2019

Choose a reason for hiding this comment

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

testDataset = mlContext.Transforms.Conversion [](start = 12, length = 45)

newline #Resolved

@@ -119,37 +127,43 @@ private static void MlContext_Log(object sender, LoggingEventArgs e)
}
Copy link
Contributor Author

@ashbhandare ashbhandare Nov 7, 2019

Choose a reason for hiding this comment

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

add output from here to comments #Resolved

LearningRate = 0.01f,
MetricsCallback = (metrics) => Console.WriteLine(metrics),
ValidationSet = testDataset
};
Copy link
Contributor Author

@ashbhandare ashbhandare Nov 7, 2019

Choose a reason for hiding this comment

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

null out ES #Resolved

Copy link
Member

@codemzs codemzs left a comment

Choose a reason for hiding this comment

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

:shipit:

@codemzs codemzs merged commit 0b9308e into dotnet:master Nov 7, 2019
@ashbhandare ashbhandare deleted the SampleCleanup branch November 7, 2019 21:47
frank-dong-ms-zz pushed a commit to frank-dong-ms-zz/machinelearning that referenced this pull request Nov 8, 2019
Remove duplicate lines from project file. (dotnet#4439)

Image Classification Sample cleanup (dotnet#4380)

* Aligned line ending to 85 char limit

* Cleaned up Early Stopping sample

* Added comments to ResnetV2101TransferLearningTrainTestSplit

* Added comments to ResnetV2101TransferLearningEarlyStopping

* Add comments to ImageClassificationDefault sample

* Added comments to LearningRateSchedulingCifarResnetTransferLearning sample

* added '.', formatted output.

* fixed sample after rebase

* fix ealy stopping sample

* fix GetAbsolutePath function for samples.

* remove unnecessary try catch block from samples.

* review comments.

Increment stable API version and add new stable packages to the list. (dotnet#4453)

* Increment stable API version and add new stable packages to the list.

* Increment stable API version and add new stable packages to the list.

also update template file

format template file

fix error in template

fix condition in template file

fix template format error

fix template parameter error

fix on template, seems corrupted when copy from github

fix placeholder

fix template error, encoding

fix template

fix in template file set system env

take comments and make adjustment
@ghost ghost locked as resolved and limited conversation to collaborators Mar 20, 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.

2 participants