是否SciPy的logsumexp()处理下溢挑战?

编程入门 行业动态 更新时间:2024-10-11 15:24:40
本文介绍了是否SciPy的logsumexp()处理下溢挑战?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

请问SciPy的的 logsumexp()实施包括由每一个元素?

Does the scipy's logsumexp() implementation include the hack that prevents underflow by subtracting the maximum found value in the array from each element?

在一个在这里下面,解释其中 M = MAXVAL :

The one explained here below, where m = maxval:

推荐答案

您可以检查源$ C ​​$ C定义 logsumexp 的此处。 (请注意,是到源链接上的商务部页)。

You can inspect the source code defining logsumexp here. (Note that there is a link to the source on the doc page).

您将看到:

a_max = a.max(axis=0) ... out = log(sum(exp(a - a_max), axis=0))

所以,是的,SciPy的的 logsumexp 是减去每个元素的最大值。

So yes, scipy's logsumexp is subtracting the maximum from each element.

更多推荐

是否SciPy的logsumexp()处理下溢挑战?

本文发布于:2023-10-24 20:53:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1524977.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:SciPy   logsumexp

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!