Callback that terminates training when a NaN loss is encountered.

callback_terminate_on_naan()