throttle

function defined in module FluxTraining


			throttle(callback, Event, freq = 1)
throttle(callback, Event, seconds = 1)

Throttle Event type for callback so that it is triggered either only every
freq ’th time or every seconds seconds.

Examples

If you want to only sporadically log metrics ( LogMetrics ) or images
( LogVisualization ), throttle can be used as follows.

Every 10 steps:


			
			callback = throttle(LogMetrics(TensorBoardBackend()), StepEnd, freq = 10)
learner = Learner(<args>; callbacks=[callback])

Or every 5 seconds:


			
			callback = throttle(LogMetrics(TensorBoardBackend()), StepEnd, seconds = 5)
learner = Learner(<args>; callbacks=[callback])
Methods

There is 1 method for throttle:

throttle(callback, event::Type{<:FluxTraining.Events.Event}; freq, seconds)
callbacks/conditional.jl:30