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 increased 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

There are 4 methods for EarlyStopping:

EarlyStopping(criterion::EarlyStopping.StoppingCriterion, state, testphase::Type{<:FluxTraining.Phases.Phase}, trainphase::Type{<:FluxTraining.Phases.Phase})
callbacks/earlystopping.jl:33
EarlyStopping(n::Int64; kwargs...)
callbacks/earlystopping.jl:49
EarlyStopping(criterion; testphase, trainphase)
callbacks/earlystopping.jl:39
EarlyStopping(criterion, state, testphase, trainphase)
callbacks/earlystopping.jl:33