KSparseBallLMO#268
Conversation
… situations, so further improvements are needed.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #268 +/- ##
==========================================
- Coverage 86.23% 82.53% -3.71%
==========================================
Files 17 22 +5
Lines 1482 2971 +1489
==========================================
+ Hits 1278 2452 +1174
- Misses 204 519 +315 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
There is only DiamondLMO(L1) and KsparseLMO |
|
Now is only Ksparse |
| struct KSparseBLMO <: FrankWolfe.LinearMinimizationOracle | ||
| K::Int | ||
| right_hand_side::Float64 | ||
| end |
| function bounded_compute_extreme_point( | ||
| lmo::KSparseBLMO, | ||
| direction, | ||
| lb, | ||
| ub, | ||
| int_vars; | ||
| v=nothing, | ||
| kwargs..., | ||
| ) |
There was a problem hiding this comment.
function bounded_compute_extreme_point(
lmo::FrankWolfe.KSparseLMO{T},
direction,
lb,
ub,
int_vars;
v=nothing,
kwargs...
)
..
end
|
|
||
| n = 20 | ||
| sparsity = 0.3 | ||
| x_sol = [rand() < sparsity ? 0 : rand(1:floor(Int, n / 4)) for _ in 1:n] | ||
| n_int = 17 |
There was a problem hiding this comment.
I would rename the file to "custom_lmo_testing.jl".
| using FrankWolfe | ||
|
|
||
|
|
||
| @testset "LMO vs MOI on the same feasible region" begin |
There was a problem hiding this comment.
Specify the feasible region as we are going to add tests for all custom LMOs.
| # --- MOI --- | ||
| model = MOI.instantiate(HiGHS.Optimizer) | ||
|
|
There was a problem hiding this comment.
I think the model would be easier to read if you use JuMP. MOI is essentially the back-end of JuMP.
|
|
||
| v_moi = [MOI.get(model, MOI.VariablePrimal(), v[i]) for i in 1:n] | ||
|
|
||
| # compare objective values (not pointwise equality!) |
There was a problem hiding this comment.
You do want to verify that you get the same point. This should check entry-wise equality.
1.Extend the Polytope LMOs from FW to Boscia: KNormBallLMO, DiamondLMO (generalisation of the L1-norm ball), KSparseLMO
2.For the DiamondLMO, the L1 norm version is the only implemented,a diamond constraint can be inputed, but the result will most likely be incorrect because it implements L1 norm. haven't figured out how to implement a diamond constraint yet.