Hello,
I am trying to run the following two lines and I am having giant errors:
using DifferentialEquations, Flux, DiffEqFlux, Optim,SciMLSensitivity , Plots, OrdinaryDiffEq, Zygote, StaticArrays, LinearAlgebra, BenchmarkTools, PaddedViews, LaTeXStrings, PGFPlotsX, PlotThemes, ApproxFun
Ωp_nn = FastChain(FastDense(1,32), FastDense(32,32,tanh), FastDense(32,32,tanh), FastDense(32,2))
θ_nn = initial_params(Ωp_nn);
optimized_sol_nn = DiffEqFlux.sciml_train(p -> cost_adjoint_nn(p, 0.08), θ_nn, RADAM(0.003), maxiters = 1000)
For the FastChain, this is the following error message:
┌ Warning: FastChain is being deprecated in favor of Lux.jl. Lux.jl uses functions with explicit parameters f(u,p) like FastChain, but is fully featured and documented machine learning library. See the Lux.jl documentation for more details.
└ @ DiffEqFlux ~/.julia/packages/DiffEqFlux/jHIee/src/fast_layers.jl:9
For the scmil_train, this is the following message:
MethodError: no method matching default_relstep(::Nothing, ::Type{ComplexF64})
Closest candidates are:
default_relstep(::Type, ::Any) at ~/.julia/packages/FiniteDiff/40JnL/src/epsilons.jl:25
default_relstep(::Val{fdtype}, ::Type{T}) where {fdtype, T<:Number} at ~/.julia/packages/FiniteDiff/40JnL/src/epsilons.jl:26Stacktrace:
[1] finite_difference_jacobian!(J::Matrix{ComplexF64}, f::Function, x::Matrix{ComplexF64}, fdtype::Nothing, returntype::Type, f_in::Nothing) (repeats 2 times)
@ FiniteDiff ~/.julia/packages/FiniteDiff/40JnL/src/jacobians.jl:298
[2] jacobian!(J::Matrix{ComplexF64}, f::Function, x::Matrix{ComplexF64}, fx::Nothing, alg::InterpolatingAdjoint{0, false, Val{:central}, Bool}, jac_config::Nothing)
@ SciMLSensitivity ~/.julia/packages/SciMLSensitivity/Wb65g/src/derivative_wrappers.jl:150
[3] _vecjacobian!(dλ::SubArray{ComplexF64, 1, Vector{ComplexF64}, Tuple{UnitRange{Int64}}, true}, y::Matrix{ComplexF64}, λ::SubArray{ComplexF64, 1, Vector{ComplexF64}, Tuple{UnitRange{Int64}}, true}, p::Vector{ComplexF64}, t::Float64, S::SciMLSensitivity.ODEInterpolatingAdjointSensitivityFunction{SciMLSensitivity.AdjointDiffCache{SciMLBase.UDerivativeWrapper{ODEFunction{false, SciMLBase.AutoSpecialize, typeof(schrodinger_nn), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Float64, Vector{ComplexF64}}, SciMLSensitivity.ParamGradientWrapper{ODEFunction{false, SciMLBase.AutoSpecialize, typeof(schrodinger_nn), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Float64, Matrix{ComplexF64}}, Nothing, Matrix{ComplexF64}, Matrix{ComplexF64}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Base.OneTo{Int64}, UnitRange{Int64}, UniformScaling{Bool}}, InterpolatingAdjoint{0, false, Val{:central}, Bool}, Matrix{ComplexF64}, ODESolution{ComplexF64, 3, Vector{Matrix{ComplexF64}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Matrix{ComplexF64}}}, ODEProblem{Matrix{ComplexF64}, Tuple{Float64, Float64}, false, Vector{ComplexF64}, ODEFunction{false, SciMLBase.AutoSpecialize, typeof(schrodinger_nn), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, BS5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.InterpolationData{ODEFunction{false, SciMLBase.AutoSpecialize, typeof(schrodinger_nn), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Vector{Matrix{ComplexF64}}, Vector{Float64}, Vector{Vector{Matrix{ComplexF64}}}, OrdinaryDiffEq.BS5ConstantCache{Float64, Float64}}, DiffEqBase.DEStats, Nothing}, Nothing, ODEProblem{Matrix{ComplexF64}, Tuple{Float64, Float64}, false, Vector{ComplexF64}, ODEFunction{false, SciMLBase.AutoSpecialize, typeof(schrodinger_nn), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, ODEFunction{false, SciMLBase.AutoSpecialize, typeof(schrodinger_nn), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}}, isautojacvec::Bool, dgrad::SubArray{ComplexF64, 1, Vector{ComplexF64}, Tuple{UnitRange{Int64}}, true}, dy::Nothing, W::Nothing)
@ SciMLSensitivity ~/.julia/packages/SciMLSensitivity/Wb65g/src/derivative_wrappers.jl:262
[4] vecjacobian!(dλ::SubArray{ComplexF64, 1, Vector{ComplexF64}, Tuple{UnitRange{Int64}}, true}, y::Matrix{ComplexF64}, λ::SubArray{ComplexF64, 1, Vector{ComplexF64}, Tuple{UnitRange{Int64}}, true}, p::Vector{ComplexF64}, t::Float64, S::SciMLSensitivity.ODEInterpolatingAdjointSensitivityFunction{SciMLSensitivity.AdjointDiffCache{SciMLBase.UDerivativeWrapper{ODEFunction{false, SciMLBase.AutoSpecialize, typeof(schrodinger_nn), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Float64, Vector{ComplexF64}}, SciMLSensitivity.ParamGradientWrapper{ODEFunction{false, SciMLBase.AutoSpecialize, typeof(schrodinger_nn), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Float64, Matrix{ComplexF64}}, Nothing, Matrix{ComplexF64}, Matrix{ComplexF64}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Base.OneTo{Int64}, UnitRange{Int64}, UniformScaling{Bool}}, InterpolatingAdjoint{0, false, Val{:central}, Bool}, Matrix{ComplexF64}, ODESolution{ComplexF64, 3, Vector{Matrix{ComplexF64}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Matrix{ComplexF64}}}, ODEProblem{Matrix{ComplexF64}, Tuple{Float64, Float64}, false, Vector{ComplexF64}, ODEFunction{false, SciMLBase.AutoSpecialize, typeof(schrodinger_nn), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, BS5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.InterpolationData{ODEFunction{false, SciMLBase.AutoSpecialize, typeof(schrodinger_nn), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Vector{Matrix{ComplexF64}}, Vector{Float64}, Vector{Vector{Matrix{ComplexF64}}}, OrdinaryDiffEq.BS5ConstantCache{Float64, Float64}}, DiffEqBase.DEStats, Nothing}, Nothing, ODEProblem{Matrix{ComplexF64}, Tuple{Float64, Float64}, false, Vector{ComplexF64}, ODEFunction{false, SciMLBase.AutoSpecialize, typeof(schrodinger_nn), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, ODEFunction{false, SciMLBase.AutoSpecialize, typeof(schrodinger_nn), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}}; dgrad::SubArray{ComplexF64, 1, Vector{ComplexF64}, Tuple{UnitRange{Int64}}, true}, dy::Nothing, W::Nothing)
@ SciMLSensitivity ~/.julia/packages/SciMLSensitivity/Wb65g/src/derivative_wrappers.jl:224
I can understand for the FirstChain, I need to change the package but what is the problem of scmil_train?
Does anyone know how to manage with this error?
Thanks in advance