Skip to content

Commit fc762a7

Browse files
committed
update docs
1 parent 8f002a5 commit fc762a7

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

code/logistic_sgd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ def sgd_optimization_mnist(learning_rate=0.13, n_epochs=1000,
441441

442442
def predict():
443443
"""
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
445445
to predict labels.
446446
"""
447447

doc/logreg.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,20 @@ approximately 1.936 epochs/sec and it took 75 epochs to reach a test
264264
error of 7.489%. On the GPU the code does almost 10.0 epochs/sec. For this
265265
instance we used a batch size of 600.
266266

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+
267281
.. rubric:: Footnotes
268282

269283
.. [#f1] For smaller datasets and simpler models, more sophisticated descent

0 commit comments

Comments
 (0)