You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For our use case in InferOpt.jl, we sometimes need to pass keyword arguments to the LMO. This is not allowed by FrankWolfe.jl, so I wrote a wrapper that predefines the kwargs with the LMO itself:
struct LMOWithKwargs{F,K} <:FrankWolfe.LinearMinimizationOracle
minimizer::F
minimizer_kwargs::KendLMOWithKwargs(minimizer) =LMOWithKwargs(minimizer, NamedTuple())
function FrankWolfe.compute_extreme_point(
lmo::LMOWithKwargs, direction; kwargs...
)
(; minimizer, minimizer_kwargs) = lmo
v =minimizer(direction; minimizer_kwargs...)
return v
end
Is there a more clever way to do this?
The text was updated successfully, but these errors were encountered:
That's exactly what I'm doing here (I edited the code above). But typically in InferOpt one might want to solve maximization problems on many different instances, passed as keyword arguments. So currently I re-create an LMO every time.
Basically I was wondering if something like this would make sense to you:
For our use case in InferOpt.jl, we sometimes need to pass keyword arguments to the LMO. This is not allowed by FrankWolfe.jl, so I wrote a wrapper that predefines the kwargs with the LMO itself:
Is there a more clever way to do this?
The text was updated successfully, but these errors were encountered: