-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Predict function for logistic regression. #92
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | |
error of 7.489%. On the GPU the code does almost 10.0 epochs/sec. For this | ||
instance we used a batch size of 600. | ||
|
||
|
||
Prediction Using a Trained Model | ||
+++++++++++++++++++++++++++++++ | ||
|
||
``sgd_optimization_mnist`` serialize and pickle the model each time new | ||
lowest validation error is reached. We can reload this model and predict | ||
labels of new data. ``predict`` function shows an example of how | ||
this could be done. | ||
|
||
.. literalinclude:: ../code/logistic_sgd.py | ||
:start-after: ' ran for %.1fs' % ((end_time - start_time))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a way to specify a function I think. This is more robust. Can you check that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I couldn't find any here: http://sphinx-doc.org/markup/code.html The rest of tutorial use them syntax too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can use
It is used in particular at https://github.com/memimo/DeepLearningTutorials/blob/predict/doc/logreg.txt#L219 in this file. |
||
:end-before: if __name__ == '__main__': | ||
|
||
|
||
.. rubric:: Footnotes | ||
|
||
.. [#f1] For smaller datasets and simpler models, more sophisticated descent | ||
|
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.
I think we told we don't use that as this is for the DLT. In the
__init__
, keep a reference to input. Do that for each example to be consistent, but you don't need to add a predict() function for each example