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 are 2 methods for CancelStepException:

CancelStepException(msg::String)
callbacks/callback.jl:184
CancelStepException(msg)
callbacks/callback.jl:184