So grateful for fast reply. But as I copy your code and run it in my Julia Pro IDE, it comes up with a error message which I cannot find an answer in the Internet, which is as below:
Need an adjoint for constructor RODESolution{Float32,2,Array{Array{Float32,1},1},Nothing,Nothing,Array{Float32,1},DiffEqNoiseProcess.NoiseProcess{Float32,2,Float32,Array{Float32,1},Array{Float32,1},Array{Array{Float32,1},1},typeof(DiffEqNoiseProcess.WHITE_NOISE_DIST),typeof(DiffEqNoiseProcess.WHITE_NOISE_BRIDGE),false,DataStructures.Stack{Tuple{Float32,Array{Float32,1},Array{Float32,1}}},ResettableStacks.ResettableStack{Tuple{Float32,Array{Float32,1},Array{Float32,1}},false},DiffEqNoiseProcess.RSWM{:RSwM3,Float64},RandomNumbers.Xorshifts.Xoroshiro128Plus},SDEProblem{Array{Float32,1},Tuple{Float32,Float32},false,Array{Float32,1},Nothing,SDEFunction{false,typeof(dudt1),typeof(dudt2),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},typeof(dudt2),Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}},Nothing},SOSRI,StochasticDiffEq.LinearInterpolationData{Array{Array{Float32,1},1},Array{Float32,1}},DiffEqBase.DEStats}. Gradient is of type Array{Float64,2}
I wonder is this because I didn’t add any package?