通过查看一些Flux示例,我拼凑出了这个逻辑预测器。然而,在计算梯度时,我会得到一个错误,Mutating arrays is not supported。如何才能得到这个预测器的梯度呢?Mutating arrays is not supported
[1] error(::String) at ./packages/Zygote/pmW1K/src/compiler/interface.jl:54
[16] top-level scope at In[11
我是Julia的新手,由于某些原因,我不能让这个非常简单的代码工作。无论我尝试什么,我都会得到错误LoadError: Mutating arrays is not supported。我知道当我在优化过程中改变一个数组,使得代码不再可微时,就会出现这个错误。很明显,我对Julia的理解还不够深入,看不出我在做什么。 如果有帮助,错误似乎发生在行for d in dataset中。using Statistics
using Flux
Mohammad Nauman的优秀著作的代码显示了这一点(朱莉娅1.5.3):using Flux.Data.MNISTimport Pkg; Pkg.add("MNIST")The following package names could not be resolved:
* MNIST(not found in project, m