-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Able to print gradients in event_handler #3085
Changes from all 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 |
---|---|---|
|
@@ -161,14 +161,14 @@ def train(self, reader, num_passes=1, event_handler=None, feeding=None): | |
self.__parameter_updater__.update(each_param) | ||
cost_sum = out_args.sum() | ||
cost = cost_sum / len(data_batch) | ||
self.__parameter_updater__.finishBatch(cost) | ||
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. Just a little confusing, why we move the 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. Need to call 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. Got it, thanks! |
||
batch_evaluator.finish() | ||
event_handler( | ||
v2_event.EndIteration( | ||
pass_id=pass_id, | ||
batch_id=batch_id, | ||
cost=cost, | ||
evaluator=batch_evaluator)) | ||
self.__parameter_updater__.finishBatch(cost) | ||
batch_evaluator.finish() | ||
|
||
self.__parameter_updater__.finishPass() | ||
pass_evaluator.finish() | ||
|
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.
rename to get_param?
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.
__getitem__
will called when doingparam[k]
, it's an operator reload. Need to keep this the same as before.