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 is 1 method for FluxTraining.CustomCallback: