This repository was archived by the owner on Jan 24, 2024. It is now read-only.
Fit a line : 2nd fix#525
Merged
daming-lu merged 5 commits intoPaddlePaddle:high-level-api-branchfrom Jun 1, 2018
daming-lu:fit_a_line_2nd_fix
Merged
Fit a line : 2nd fix#525daming-lu merged 5 commits intoPaddlePaddle:high-level-api-branchfrom daming-lu:fit_a_line_2nd_fix
daming-lu merged 5 commits intoPaddlePaddle:high-level-api-branchfrom
daming-lu:fit_a_line_2nd_fix
Conversation
added 2 commits
May 30, 2018 20:16
daming-lu
commented
May 31, 2018
| # event_handler to print training and testing info | ||
| def event_handler(event): | ||
| def event_handler_plot(event): | ||
| global step |
Contributor
Author
There was a problem hiding this comment.
Here we still need a global step because event.step only goes 0-20 in one EndStepEvent. We need the step to keep growing. Otherwise the plot would look weird like zig-zag.
| print('loss is less than 10.0, stop') | ||
| trainer.stop() | ||
|
|
||
| if step >= 2000: |
Contributor
Author
| # We can save the trained parameters for the inferences later | ||
| if params_folder is not None: | ||
| trainer.save_params(params_folder) | ||
| if params_dirname is not None: |
| reader=train_reader, | ||
| num_epochs=100, | ||
| event_handler=event_handler, | ||
| event_handler=event_handler_plot, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.