Hyperopt.jl
Hyperopt.jl copied to clipboard
error when there is only one param to optimize
julia> @hyperopt for i=10, a=LinRange(1,10,10)
a
end
ERROR: UndefVarError: a not defined
Stacktrace:
[1] macro expansion
@ ./REPL[33]:2 [inlined]
[2] var"#395###hyperopt_objective#281"(i::Int64, state::Float64)
@ Main /julia/dev/Hyperopt.jl/src/Hyperopt.jl:152
it's caused by function flamingo(i, state)
and function flamingo((i, a)...)
are the same.
shall we change state
to a keyword argument? or document this limitation? I think this is a rare case.
julia> @expand @hyperopt for i=10, a=LinRange(1,10,10)
a
end
:(Hyperopt.optimize(begin
#= /julia/dev/Hyperopt.jl/src/Hyperopt.jl:179 =#
(wildebeest, eagle) = (begin
#= /julia/dev/Hyperopt.jl/src/Hyperopt.jl:147 =#
function flamingo((i, a)...)
#= /julia/dev/Hyperopt.jl/src/Hyperopt.jl:147 =#
#= /julia/dev/Hyperopt.jl/src/Hyperopt.jl:148 =#
state = nothing
#= /julia/dev/Hyperopt.jl/src/Hyperopt.jl:149 =#
begin
#= REPL[32]:2 =#
a
end
end
#= /julia/dev/Hyperopt.jl/src/Hyperopt.jl:151 =#
function flamingo(i, state)
#= /julia/dev/Hyperopt.jl/src/Hyperopt.jl:151 =#
#= /julia/dev/Hyperopt.jl/src/Hyperopt.jl:152 =#
begin
#= REPL[32]:2 =#
a
end
end
end, 10)
Would it be hard to make state work as a keyword argument? Seems to be something that is used for the hyperband stuff (based on what tests failed when I took it away), but I haven't really looked in to that code so I'm not sure exactly what is going on?