2 ms·
Yes! For some applications including machine learning you can set the option to flush denormals to zero so you don't hit this case. Infinity and NaN can also b
by modeless 8y ago
Yes! For some applications including machine learning you can set the option to flush denormals to zero so you don't hit this case.
Infinity and NaN can also be a performance problem but it depends on your processor. Though of course if you get those during matrix multiplication something has probably gone wrong.
- adrianratnapala 8y agoDepends on what you mean by wrong. The point of NaNs and infinities is that sometimes it is easier/faster/cleaner to just let those things propagate through the calculation than to do conditional logic that in the end just tends to just simulate the same effect. True, that consideration is more valid for element-by-element operations rather than things like matrix multiplications. But depending on the operation it might make sense to rely on NaN propagation rather than trying to prescan you matrix for NaNs.