84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
我在尝试用Node.js实现神经网络的过程中发现计算值出现了Infinity,经过检查发现在计算以下这个几乎线性增长的函数时,
function softmax(x0){ return Math.log(Math.exp(x0)+1); }
如果输入的值超过大约700就会输出Inf,这应该是因为Math.exp(x0)超过了浮点数的上界。我并不很擅长写 Python,因为Python不太符合我的代码习惯。请问为了防止出现溢出,是否有比换成Python更好的办法?
ringa_lee
ringa_lee