EarlyStopping

struct defined in module FluxTraining


			EarlyStopping(criteria...; kwargs...)
EarlyStopping(n)

Stop training early when criteria are met. See EarlyStopping.jl for available stopping criteria.

Passing an integer n uses the simple patience criterion: stop if the validation loss hasn't decreased for n epochs.

You can control which phases are taken to measure the out-of-sample loss and the training loss with keyword arguments trainphase (default AbstractTrainingPhase ) and testphase (default AbstractValidationPhase ).

Examples


			
			
			

	
			Learner
			(
			model
			,
			 
			lossfn
			,
			 
			
			callbacks
			=
			
			[
			

			EarlyStopping
			(
			3
			)
			]
			)

			
			
			
			
			import
			
			 

	
			FluxTraining
			.

	
			ES
			:
			
			 
			Disjunction
			,
			
			 
			InvalidValue
			,
			
			 
			TimeLimit
			

			

			
			callback
			 
			=
			 
			

			EarlyStopping
			(
			
			Disjunction
			(
			
			InvalidValue
			(
			)
			,
			 
			
			TimeLimit
			(
			0.5
			)
			)
			)
			

			

	
			Learner
			(
			model
			,
			 
			lossfn
			,
			 
			
			callbacks
			=
			
			[
			callback
			]
			)
Methods