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
.
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
There are
2
methods for CancelStepException
:
CancelStepException(msg::String)
CancelStepException(msg)
The following pages link back here: