Closed Cyberface closed 2 years ago
Hi,
I'm following the GPR example here but when I try to run
optimize!(gp)
I get the following error
InexactError: Int64(103.91337059292768) Stacktrace: [1] (::GaussianProcesses.var"#ltarget_and_dltarget!#102"{Base.Iterators.Pairs{Symbol, Bool, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:kern, :domean, :noise), Tuple{Bool, Bool, Bool}}}, GPE{LinearAlgebra.Adjoint{Float64, Vector{Float64}}, Vector{Float64}, MeanZero, SEIso{Float64}, GaussianProcesses.FullCovariance, GaussianProcesses.IsotropicData{Matrix{Float64}}, PDMats.PDMat{Float64, Matrix{Float64}}, GaussianProcesses.Scalar{Int64}}})(grad::Vector{Float64}, hyp::Vector{Float64}) @ GaussianProcesses ~/.julia/packages/GaussianProcesses/kzIIW/src/optimize.jl:85 [2] value_gradient!!(obj::OnceDifferentiable{Float64, Vector{Float64}, Vector{Float64}}, x::Vector{Float64}) @ NLSolversBase ~/.julia/packages/NLSolversBase/GRQ1x/src/interface.jl:82 [3] value_gradient!(obj::OnceDifferentiable{Float64, Vector{Float64}, Vector{Float64}}, x::Vector{Float64}) @ NLSolversBase ~/.julia/packages/NLSolversBase/GRQ1x/src/interface.jl:69 [4] value_gradient!(obj::Optim.ManifoldObjective{OnceDifferentiable{Float64, Vector{Float64}, Vector{Float64}}}, x::Vector{Float64}) @ Optim ~/.julia/packages/Optim/3K7JI/src/Manifolds.jl:50 [5] (::LineSearches.var"#ϕdϕ#6"{Optim.ManifoldObjective{OnceDifferentiable{Float64, Vector{Float64}, Vector{Float64}}}, Vector{Float64}, Vector{Float64}, Vector{Float64}})(α::Float64) @ LineSearches ~/.julia/packages/LineSearches/Ki4c5/src/LineSearches.jl:84 [6] (::LineSearches.HagerZhang{Float64, Base.RefValue{Bool}})(ϕ::Function, ϕdϕ::LineSearches.var"#ϕdϕ#6"{Optim.ManifoldObjective{OnceDifferentiable{Float64, Vector{Float64}, Vector{Float64}}}, Vector{Float64}, Vector{Float64}, Vector{Float64}}, c::Float64, phi_0::Float64, dphi_0::Float64) @ LineSearches ~/.julia/packages/LineSearches/Ki4c5/src/hagerzhang.jl:139 [7] HagerZhang @ ~/.julia/packages/LineSearches/Ki4c5/src/hagerzhang.jl:101 [inlined] [8] perform_linesearch!(state::Optim.LBFGSState{Vector{Float64}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Float64, Vector{Float64}}, method::LBFGS{Nothing, LineSearches.InitialStatic{Float64}, LineSearches.HagerZhang{Float64, Base.RefValue{Bool}}, Optim.var"#17#19"}, d::Optim.ManifoldObjective{OnceDifferentiable{Float64, Vector{Float64}, Vector{Float64}}}) @ Optim ~/.julia/packages/Optim/3K7JI/src/utilities/perform_linesearch.jl:59 [9] update_state!(d::OnceDifferentiable{Float64, Vector{Float64}, Vector{Float64}}, state::Optim.LBFGSState{Vector{Float64}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Float64, Vector{Float64}}, method::LBFGS{Nothing, LineSearches.InitialStatic{Float64}, LineSearches.HagerZhang{Float64, Base.RefValue{Bool}}, Optim.var"#17#19"}) @ Optim ~/.julia/packages/Optim/3K7JI/src/multivariate/solvers/first_order/l_bfgs.jl:204 [10] optimize(d::OnceDifferentiable{Float64, Vector{Float64}, Vector{Float64}}, initial_x::Vector{Float64}, method::LBFGS{Nothing, LineSearches.InitialStatic{Float64}, LineSearches.HagerZhang{Float64, Base.RefValue{Bool}}, Optim.var"#17#19"}, options::Optim.Options{Float64, Nothing}, state::Optim.LBFGSState{Vector{Float64}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Float64, Vector{Float64}}) @ Optim ~/.julia/packages/Optim/3K7JI/src/multivariate/optimize/optimize.jl:57 [11] optimize(d::OnceDifferentiable{Float64, Vector{Float64}, Vector{Float64}}, initial_x::Vector{Float64}, method::LBFGS{Nothing, LineSearches.InitialStatic{Float64}, LineSearches.HagerZhang{Float64, Base.RefValue{Bool}}, Optim.var"#17#19"}, options::Optim.Options{Float64, Nothing}) (repeats 2 times) @ Optim ~/.julia/packages/Optim/3K7JI/src/multivariate/optimize/optimize.jl:35 [12] optimize!(::GPE{LinearAlgebra.Adjoint{Float64, Vector{Float64}}, Vector{Float64}, MeanZero, SEIso{Float64}, GaussianProcesses.FullCovariance, GaussianProcesses.IsotropicData{Matrix{Float64}}, PDMats.PDMat{Float64, Matrix{Float64}}, GaussianProcesses.Scalar{Int64}}, ::LBFGS{Nothing, LineSearches.InitialStatic{Float64}, LineSearches.HagerZhang{Float64, Base.RefValue{Bool}}, Optim.var"#17#19"}; domean::Bool, kern::Bool, noise::Bool, lik::Bool, meanbounds::Nothing, kernbounds::Nothing, noisebounds::Nothing, likbounds::Nothing, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}) @ GaussianProcesses ~/.julia/packages/GaussianProcesses/kzIIW/src/optimize.jl:28 [13] optimize! (repeats 2 times) @ ~/.julia/packages/GaussianProcesses/kzIIW/src/optimize.jl:23 [inlined] [14] top-level scope @ In[10]:1 [15] eval @ ./boot.jl:360 [inlined] [16] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String) @ Base ./loading.jl:1116
Any ideas?
I'm quite new to Julia and don't have much experience debugging sorry.
Thanks!
I found the error.
I was using an integer for logObsNoise = -1.
logObsNoise = -1
Simply changing this to a float -> logObsNoise = -1.0 fixes my problem.
logObsNoise = -1.0
Hi,
I'm following the GPR example here but when I try to run
I get the following error
Any ideas?
I'm quite new to Julia and don't have much experience debugging sorry.
Thanks!