CancelEpochException

struct defined in module FluxTraining


			CancelEpochException(message)

Throw during fitting to cancel the currently running epoch.
This prematurely ends the current epoch without throwing an error.
Must be thrown inside the context of runepoch .

Examples


			
			
			
			
	
		
			runepoch
			
			(
			
			learner
			
			,
			
			 
			
			phase
			
			)
			
			 
			
			do
			
			
			
			 
			
			_
			
			
			
    
			
			
			for
			
			
			 
			
			batch
			
			 
			
			in
			
			 
			
			batches
			
			
			
        
			
			
	
		
			step!
			
			(
			
			learner
			
			,
			
			 
			
			phase
			
			,
			
			 
			
			batch
			
			)
			
			
        
			
			
			if
			
			
			 
			
			
			
			learner
			
			.
			
			
			step
			
			.
			
			
			loss
			
			 
			
			<
			
			 
			
			1.
			
			
			
            
			
			
			throw
			
			(
			
			
	
		
			CancelEpochException
			
			(
			
			"
			
			Reached target loss
			
			"
			
			)
			
			)
			
			
        
			
			end
			
			
    
			
			end
			
			

			
			end
Methods

There are 2 methods for CancelEpochException:

CancelEpochException(msg::String)
callbacks/callback.jl:209
CancelEpochException(msg)
callbacks/callback.jl:209