Skip to content

Commit 3edfa4d

Browse files
author
Saurabh Garg
committed
Improved formatting.
1 parent 2f589b5 commit 3edfa4d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

+22
Original file line numberDiff line numberDiff line change
@@ -7,47 +7,65 @@ I wrote `TrainCNN.py` so that I can easily experiment with some of the important
77
`TrainCNN.py` accepts the following command line arguments:
88

99
**General Parameters:**
10+
1011
`--cnnArch {Custom,VGG16}`
12+
1113
      The CNN architecture (default: Custom)
1214

1315
`--classMode {Categorical,Binary}`
16+
1417
      The class mode of the data (default: Categorical)
1518

1619
**Hyper Parameters:**
20+
1721
`--optimizer {Adam,SGD,RMSProp}`
22+
1823
      The optimization function (default: Adam)
1924

2025
`--learningRate LEARNINGRATE`
26+
2127
      The learning rate (default: 0.0001)
2228

2329
`--imageSize IMAGESIZE`
30+
2431
      The image size (default: 224)
2532

2633
`--numEpochs NUMEPOCHS`
34+
2735
      The maximum number of epochs to train (default: 30)
2836

2937
`--batchSize BATCHSIZE`
38+
3039
      The batch size to use for training (default: 25)
3140

3241
**Output Parameters:**
42+
3343
`--outputFileNamePrefix OUTPUTFILENAMEPREFIX`
44+
3445
      The prefix for all output files (default: Foo)
3546

3647
`--resultsFileName RESULTSFILENAME`
48+
3749
      File name of the common output CSV (default: Results.csv)
3850

3951
**Regularization Parameters:**
52+
4053
`--dropout/--no-dropout`
54+
4155
      Enable/disable dropout regularization. (default: False)
4256

4357
`--augmentation/--no-augmentation`
58+
4459
      Enable/disable image augmentations. (default: False)
4560

4661
`--augMultiplier AUGMULTIPLIER`
62+
4763
      With image augmentation, number of images in the dataset times this multiplier is used for training. (default: 3)
4864

4965
**Other Parameters:**
66+
5067
`--debug/--no-debug`
68+
5169
      Enable/disable debugging. Debugging mode uses a smaller dataset for faster execution. (default: False)
5270

5371
Most of the parameters are self explanatory, here I explain only some of the more obscure of them:
@@ -86,15 +104,19 @@ Running these four command will generate the following files:
86104
`LogisticRegression.py` trains a classifier for Kaggle’s dogs vs. cats dataset. It accepts the following command line arguments:
87105

88106
`--imageSize`
107+
89108
   Logistic regression expects all samples to have the same number of features. imageSize is used to specify the size to which all images in a dataset will be rescaled to (default: 100)
90109

91110
`--solver {lbfgs,sag,saga}`
111+
92112
   Choose the solver used to minimize the cost function for logistic regression (default: lbfgs)
93113

94114
`--rescale / –-no-rescale`
115+
95116
   Enable rescaling pixel values in images to [0.0, 1.0] and standardize all images so that each pixel has a zero mean and 1.0 standard deviation (default: --no-rescale)
96117

97118
`--debug / --no-debug`
119+
98120
   Enable debugging. In debugging mode, only first 100 images are used
99121

100122
On first run, `LogisticRegression.py` stores the entire dataset as numpy arrays after rescaling (if specified) to a npz array. On subsequent runs, it loads this file to save time on resizing images and rescaling pixel values. The fitted model is saved to a file with prefix LRModel. Finally, `LogisticRegression.py` appends its results to `LogisticRegression.csv` with the following columns: solver, image size, rescaled, training accuracy, validation accuracy, time taken to fit model, and total time. This makes it easy to compare results from different parameters.

0 commit comments

Comments
 (0)