CancelStepException

struct defined in module FluxTraining


			CancelStepException(message)

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

Examples


			
			
			
			

	
			runepoch
			(
			learner
			,
			 
			phase
			)
			 
			do
			
			 
			_
			
			
    
			
			for
			
			 
			
			(
			xs
			,
			 
			ys
			)
			 
			in
			 
			batches
			
			
        
			
			

	
			runstep
			(
			learner
			,
			 
			phase
			,
			 
			
			(
			
			;
			 
			xs
			,
			 
			ys
			)
			)
			 
			do
			
			 
			_
			,
			 

	
			state
			
			
            
			# training logic...
			
            
			
			if
			 
			
			
			
			isnan
			(
			

	
			state
			.
			
			loss
			)
			.
			
			
                
			throw
			(
			

			CancelStepException
			(
			
			"
			Skipping NaN loss
			"
			)
			)
			
			
            
			end
			
        
			end
			
    
			end
			

			end
Methods

There is 1 method for FluxTraining.CancelStepException: