GeezerVison is showing github.com — update docs · netankit/DeepLearningTutorials@fc762a7
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: code/logistic_sgd.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -441,7 +441,7 @@ def sgd_optimization_mnist(learning_rate=0.13, n_epochs=1000, |
441 | 441 |
|
442 | 442 | def predict(): |
443 | 443 | """ |
444 | | - An example of how to load a train model and use it |
| 444 | + An example of how to load a trained model and use it |
445 | 445 | to predict labels. |
446 | 446 | """ |
447 | 447 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: doc/logreg.txt +14Lines changed: 14 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -264,6 +264,20 @@ approximately 1.936 epochs/sec and it took 75 epochs to reach a test |
264 | 264 | error of 7.489%. On the GPU the code does almost 10.0 epochs/sec. For this |
265 | 265 | instance we used a batch size of 600. |
266 | 266 |
|
| 267 | + |
| 268 | +Prediction Using a Trained Model |
| 269 | ++++++++++++++++++++++++++++++++ |
| 270 | + |
| 271 | +``sgd_optimization_mnist`` serialize and pickle the model each time new |
| 272 | +lowest validation error is reached. We can reload this model and predict |
| 273 | +labels of new data. ``predict`` function shows an example of how |
| 274 | +this could be done. |
| 275 | + |
| 276 | +.. literalinclude:: ../code/logistic_sgd.py |
| 277 | + :start-after: ' ran for %.1fs' % ((end_time - start_time))) |
| 278 | + :end-before: if __name__ == '__main__': |
| 279 | + |
| 280 | + |
267 | 281 | .. rubric:: Footnotes |
268 | 282 |
|
269 | 283 | .. [#f1] For smaller datasets and simpler models, more sophisticated descent |
|