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