How to do with Nan values in the output of the net?

There are NaN values in the output of the net, how to do with them in the custom Loss function?

@cqiaoYc That is an indicator of underflow. Could you post more about your loss function?