Allow both `every` and `once` args to be defined in Events.*
See original GitHub issue🚀 Feature
Allow users to define both every
and once
arguments in Events.*
The use case is I want to log the training loss at the first iteration to check that the loss makes sense or not, and then log the training loss at every iteration.
As of today per Events docs, we can use like
e = Events.ITERATION_COMPLETED(every=100) | Events.ITERATION_COMPLETED(once=1)
@engine.on(e)
def log_loss(engine):
...
It would be more useful if we can use like
e = Events.ITERATION_COMPLETED(every=100, once=1)
@engine.on(e)
def log_loss(engine):
...
Comments are welcome!
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Javascript event handler with parameters - Stack Overflow
// Let's use use good old function sytax function event_handler(event, arg) { console.log(event, arg); } // Assign the listener callback to a ...
Read more >Unity Events, passing multiple arguments
I've been using Unity Events for a few weeks now, and whilst they ... UI system has events with a single parameter, but...
Read more >EventTarget.addEventListener() - Web APIs | MDN
It allows adding more than one handler for an event. ... It works on any event target, not just HTML or SVG elements....
Read more >Set up event parameters | Google Analytics 4 Properties
This guide shows you how to set up parameters for recommended events and custom events on your website so you can collect more...
Read more >[GA4] Configure Google Analytics 4 in Google Tag Manager
Google Tag Manager allows you to set up and manage GA4 events all in one place. To send event data from Google Tag...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As I said previously, I think it can be a bit misleading. On the other hand if user would like to have both, this can be done with a custom filter:
See https://pytorch.org/ignite/engine.html#ignite.engine.events.Events
@ydcjeff thanks for feature request ! I was thinking about having
every
andonce
available together and IMO it can be a bit misleading inside a single event as you suggest:Events.ITERATION_COMPLETED(every=100, once=1)
… However, I understand that it could be interesting to introduce something to simplify:@sdesrozis what do you think ?