3

I am trying to learn the syntax of NeuralPDE.jl for some PINN work by going through the documentation tutorials found here.

When building the PINN algorithm using the PhysicsInformedNN(chain, strategy) function, I am getting a MethodError for whichever strategy I attempt to use. The tutorial suggests GridTraining(.05) and I also tried the StochasticTraining(::Int64) with no luck.

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

ERROR:

MethodError: no method matching GridTraining(::Float64)
logankilpatrick
  • 13,148
  • 7
  • 44
  • 125
  • 1
    can you share `]st`? You probably aren't on the latest versions. – Chris Rackauckas Mar 11 '21 at 22:23
  • Thank you for taking the time to try to help. Granted I have a lot of unnecessary installations installed since I'm still in the exploring phase of trying to migrate over from Python. \n Atom v0.12.28 Blink v0.12.3 CSSUtil v0.1.1 CSV v0.7.10 Colors v0.12.4 DataFrames v0.21.8 DiffEqFlux v1.21.0 Distances v0.9.2 Distributions v0.23.8 EvoTrees v0.5.3 Flux v0.11.1 GLM v1.3.11 GalacticOptim v0.1.3 HypothesisTests v0.10.2 IJulia v1.23.1 IRTools v0.4.2 Impute v0.6.0 Interact v0.10.3 Juno v0.8.4 – Robert Reaney Mar 12 '21 at 14:50
  • Latexify v0.14.6 LoopVectorization v0.9.20 LossFunctions v0.6.2 MLJ v0.15.0 MLJBase v0.16.2 MLJDecisionTreeInterface v0.1.0 MLJGLMInterface v0.1.2 MLJModels v0.13.1 MLJMultivariateStatsInterface v0.1.6 MLJScikitLearnInterface v0.1.7 ModelingToolkit v3.20.1 MultivariateStats v0.7.0 NearestNeighbors v0.4.8 NeuralPDE v2.2.0 Optim v0.22.0 Plots v1.9.1 Pluto v0.12.17 PyCall v1.92.1 PyPlot v2.9.0 Query v1.0.0 RCall v0.13.10 RDatasets v0.7.3 ScikitLearn v0.6.2 StatsBase v0.32.2 StatsPlots v0.14.17 UrlDownload v0.3.1 Zygote v0.5.17 Thank you for commenting on my post! – Robert Reaney Mar 12 '21 at 14:50
  • 1
    `ModelingToolkit v3.20.1` you're just on a very old version of MTK. Is this Julia v1.5? – Chris Rackauckas Mar 12 '21 at 17:17

1 Answers1

2

It was a package version issue. When updating to the most recent version it was fixed. See the comments for more information.

Chris Rackauckas
  • 18,645
  • 3
  • 50
  • 81