terminate_on_nan
TerminateOnNaN
¶
Bases: Trace
End Training if a NaN value is detected.
By default (monitor_names=None) it will monitor all loss values at the end of each batch. If one or more inputs are specified, it will only monitor those values. Inputs may be loss keys and/or the keys corresponding to the outputs of other traces (ex. accuracy).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
monitor_names |
Union[None, str, Iterable[str]]
|
key(s) to monitor for NaN values. If None, all loss values will be monitored. "*" will monitor all trace output keys and losses. |
None
|
mode |
Union[None, str, Set[str]]
|
What mode(s) to execute this Trace in. For example, "train", "eval", "test", or "infer". To execute regardless of mode, pass None. To execute in all modes except for a particular one, you can pass an argument like "!infer" or "!train". |
None
|
ds_id |
Union[None, str, Iterable[str]]
|
What dataset id(s) to execute this Trace in. To execute regardless of ds_id, pass None. To execute in all ds_ids except for a particular one, you can pass an argument like "!ds1". |
None
|