Improve Frequency
See original GitHub issue🚀 Feature
If we would like to log datapoints/second every 100 iterations, we most probably do like this
wps_metric = Frequency(output_transformer=lambda x: x['ntokens'])
wps_metric.attach(trainer, name='wps', event_name=Events.ITERATION_COMPLETED(every=100))
however, seems like this wont take into account all other iterations while computing the total number of tokens.
class Frequency(Metric):
....
def attach(self, engine, name, event_name=Events.ITERATION_COMPLETED):
engine.add_event_handler(Events.EPOCH_STARTED, self.started)
engine.add_event_handler(event_name, self.iteration_completed)
engine.add_event_handler(event_name, self.completed, name)
IMO, should be
class Frequency(Metric):
....
def attach(self, engine, name, event_name=Events.ITERATION_COMPLETED):
engine.add_event_handler(Events.EPOCH_STARTED, self.started)
engine.add_event_handler(Events.ITERATION_COMPLETED, self.iteration_completed)
engine.add_event_handler(event_name, self.completed, name)
cc @erip
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
How to Raise Your Emotional & Spiritual Vibration
Learn how to raise your emotional vibration frequency with these tips from Chopra. Raise your vibrations and support positivity in your life.
Read more >20 Ways To Increase Your Vibrational Frequency | ITN Blog
5. PARTICIPATE IN JOYFUL MOVEMENT. Joyful movement stimulates the release of endorphins, which help to increase your vibrational frequency.
Read more >Studying frequency processing of the brain to enhance long ...
It is envisaged that the brain could be stimulated through binaural beats (sound frequency) at 40 Hz (gamma) to enhance long-term memory capacity....
Read more >Increase frequency definition and meaning - Collins Dictionary
Increase frequency definition: The frequency of an event is the number of times it happens during a particular period.... | Meaning, pronunciation ...
Read more >365 Ways to Raise Your Frequency: Simple Tools to Increase ...
365 Ways to Raise Your Frequency: Simple Tools to Increase Your Spiritual Energy for Balance, Purpose, and Joy [Alvarez, Melissa] on Amazon.com.
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 FreeTop 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
Top GitHub Comments
Not sure how I missed the cc here - sorry about that! Let me reacquaint myself quickly and I’ll try to submit a PR.
@erip I’m on Mac too, the following test passes on
master
on my computer.Anyway, please send the PR and we can see what happens. I think we also need to improve the docs and explain better the purpose of
event_name
argument.