-
-
Notifications
You must be signed in to change notification settings - Fork 657
Open
Labels
Description
Hi,
I noticed that since event handlers are invoked at the order of their insertion, there's a potential bug- if a metric handler is inserted after a TensorBoard handler, the metric value will not be ready at the time of writing.
While this has only minor effects (one epoch shift in the results), I think it can be easily solved by one of two approaches:
- separating handlers list to two: one for metrics, and the other handler types.
- More generic and scalable- allowing users to decide the order of execution by adding priority argument to
add_event_handler
(default would be that metric handlers are inserted with higher priority) and then sort the list whenrun()
is invoked.
Let me know if you like any of the ideas, and I'd be happy to draft a PR
alxlampe