CustomCallback

struct defined in module FluxTraining


			CustomCallback(f, Event, [TPhase = Phase, access = (;)])

A callback that runs f(learner) every time an event of type Event
during a phase of type in Phase .

If f needs to access learner state, pass access , a named tuple
in the same form as stateaccess .

Instead of using CustomCallback it is recommended to properly
implement a Callback .

Examples

We can get a quick idea of when a new epoch starts as follows:


			
			
			
			cb
			
			 
			
			=
			
			 
			
			
	
		
			CustomCallback
			
			(
			
			
			learner
			
			 
			
			->
			
			 
			
			
			println
			
			(
			
			"
			
			New epoch!
			
			"
			
			)
			
			,
			
			 
			
	
		
			EpochBegin
			
			)
Methods

There are 3 methods for CustomCallback:

CustomCallback(f, E::Type{<:FluxTraining.Events.Event})
callbacks/custom.jl:27
CustomCallback(f, E::Type{<:FluxTraining.Events.Event}, P::Type{<:FluxTraining.Phases.Phase})
callbacks/custom.jl:27
CustomCallback(f, E::Type{<:FluxTraining.Events.Event}, P::Type{<:FluxTraining.Phases.Phase}, access)
callbacks/custom.jl:27