Python中使用Autograd包的梯度

2024-10-03 04:35:56 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图使用Autograd包复制{a1}。在

虽然我可以从这个存储库复制其他示例,但这个特定的示例会抛出一个错误,如下所示:

    /home/avuis/anaconda/lib/python3.6/sitepackages/autograd/numpy/numpy_vjps.py:444: FutureWarning: 
Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. 
In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
      return lambda g: g[idxs]

此相关版本是否不兼容?如果是这样,有什么快速的方法来解决这个问题?在

提前谢谢你


Tags: numpyan示例homea1错误anacondaresult
1条回答
网友
1楼 · 发布于 2024-10-03 04:35:56

请尝试将您的scipy包更新到新版本。我使用的版本是1.0.0,这个例子很有用。在

然而,即使有了这种改变,这个例子也不起作用。它运行时没有错误,但不会产生任何结果。我的猜测是Hessian和Jacobian近似是错误的,并且最小化算法没有收敛。如果一个人尝试使用另一个最小化算法,它确实会收敛(缓慢但稳定)。回购中应该表示输出的当前图像已过时,因为在最新版本的代码中,pinwheel中的类数是3而不是5。在

相关问题 更多 >