下载和日志值在java [英] underflow and log values in java
问题描述
避免下溢问题的标准方法是从小的浮点数乘以结果是使用log(x)而不是x
假设x = 0.50,其日志是log(x)= - 0.301029996
以稍后恢复的值exp(log( x))!= x这是
0.740055574!= 0.50
那么,如何使用对数有用的处理下溢?
这与溢出无关。在第一个日志
中,您可以计算基数10中的 log
,而不是自然对数。您可以这样做:
提高 10 ^ log(x)
以获取 x
,或使用自然对数。
I have a question in regard to dealing with small probabilities values in machine learning models.
The standard way to avoid underflow problems which results from multiplying small floating-point numbers is to use log(x) instead of x
suppose that x=0.50 the log of which is log(x)=-0.301029996
to recover x later on the value of exp(log(x)) != x that is
0.740055574 != 0.50
So, how is using the logarithm is useful to deal with underflow??
This has nothing to do with the overflow. In the first log
, you compute the log
in base 10, instead of the natural logarithm. You can do this:
raise 10^log(x)
to get back x
, or use the natural logarithm.
这篇关于下载和日志值在java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!