I am working with the code in this gist.
In the file test_autochoice_mew2.jl , I have the following pieces of code:
[...]
T = promote_type(promote_type(promote_type(eltype(X),eltype(b)),eltype(Z)),eltype(W))
[...]
ℓ = zero(T)
[...]
rs = optimize(td, bstart, LBFGS(; linesearch = LineSearches.BackTracking()), Optim.Options(iterations=100_000,g_tol=1e-8,f_tol=1e-8))
β = Optim.minimizer(rs)
ℓ = Optim.minimum(rs)*(-1)
When I try to print like
(which is what I’ve labeled ℓ
’s output) at the end of the function, I get the following output that means nothing to me:
julia> like
Dual{ForwardDiff.Tag{getfield(Main, Symbol("#f#3")){Array{Float64,1},Array{Float64,2},Array{Float64,3},Int64,Array{Float64,1},Int64,Int64},Float64}}(Dual{ForwardDiff.Tag{getfield(Main, Symbol("#f#3")){Array{Float64,1},Array{Float64,2},Array{Float64,3},Int64,Array{Float64,1},Int64,Int64},Float64}}(255.55119809155235,-5.033796958153758e-7,-1.0804235078265556e-5,-3.4508112290165815e-6,2.989085825272353e-6,7.117737226280951e-6),Dual{ForwardDiff.Tag{getfield(Main, Symbol("#f#3")){Array{Float64,1},Array{Float64,2},Array{Float64,3},Int64,Array{Float64,1},Int64,Int64},Float64}}(-5.033796958153758e-7,66.48776626068965,47.6826072832014,-41.057855033352624,-26.4964747155521,854.6887718388765),Dual{ForwardDiff.Tag{getfield(Main, Symbol("#f#3")){Array{Float64,1},Array{Float64,2},Array{Float64,3},Int64,Array{Float64,1},Int64,Int64},Float64}}(-1.0804235078265556e-5,47.6826072832014,47.6826072832014,-26.4964747155521,-26.4964747155521,612.3806230745521),Dual{ForwardDiff.Tag{getfield(Main, Symbol("#f#3")){Array{Float64,1},Array{Float64,2},Array{Float64,3},Int64,Array{Float64,1},Int64,Int64},Float64}}(-3.4508112290165815e-6,-41.057855033352624,-26.4964747155521,49.178844548215885,32.485863319462716,-433.9826291198754),Dual{ForwardDiff.Tag{getfield(Main, Symbol("#f#3")){Array{Float64,1},Array{Float64,2},Array{Float64,3},Int64,Array{Float64,1},Int64,Int64},Float64}}(2.989085825272353e-6,-26.4964747155521,-26.4964747155521,32.485863319462716,32.485863319462716,-263.0385457700083),Dual{ForwardDiff.Tag{getfield(Main, Symbol("#f#3")){Array{Float64,1},Array{Float64,2},Array{Float64,3},Int64,Array{Float64,1},Int64,Int64},Float64}}(7.117737226280951e-6,854.6887718388763,612.380623074552,-433.9826291198754,-263.0385457700083,12296.248925836317))
I am confident this is coming from the line above where I do a bunch of type promotions. But I don’t know how to get it back to the Float64
that I know like
should be.
Does anyone know how I can do that?