Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Fit a line : 2nd fix #525

Merged
merged 5 commits into from
Jun 1, 2018
Merged

Fit a line : 2nd fix #525

merged 5 commits into from
Jun 1, 2018

Conversation

daming-lu
Copy link
Contributor

No description provided.

@daming-lu daming-lu changed the base branch from develop to high-level-api-branch May 31, 2018 03:30
step = 0

# event_handler to print training and testing info
def event_handler(event):
def event_handler_plot(event):
global step
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@@ -212,14 +210,9 @@ def event_handler(event):
print('loss is less than 10.0, stop')
trainer.stop()

if step >= 2000:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed. It takes a few minutes to converge. Only a bit longer than step == 2000

screen shot 2018-05-30 at 8 28 05 pm

# 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:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed name

@@ -233,7 +226,7 @@ def event_handler(event):
trainer.train(
reader=train_reader,
num_epochs=100,
event_handler=event_handler,
event_handler=event_handler_plot,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed name

@daming-lu daming-lu merged commit fdcd800 into PaddlePaddle:high-level-api-branch Jun 1, 2018
@daming-lu daming-lu deleted the fit_a_line_2nd_fix branch June 1, 2018 00:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant