由于策略争论,使用来自 NueralPDE.jl 的 PhysicsInformedNN() 时出现 MethodError

问题描述

我正在尝试通过查看 here 中的文档教程来学习 NeuralPDE.jl 的语法以进行一些 PINN 工作。

使用 PhysicsInformednN(chain,strategy) 函数构建 PINN 算法时,无论我尝试使用哪种策略,都会收到 MethodError。本教程建议使用 GridTraining(.05),我也尝试了 stochasticTraining(::Int64),但没有成功。

dim = 2 # number of dimensions
chain = FastChain(FastDense(dim,16,Flux.σ),FastDense(16,1))
dx = 0.05
discretization = PhysicsInformednN(chain,GridTraining(dx))

错误

MethodError: no method matching GridTraining(::Float64)

解决方法

这是一个包版本问题。更新到最新版本时,它已修复。有关详细信息,请参阅评论。