-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support blmo type and passed test for Cube polytope #188
base: main
Are you sure you want to change the base?
Conversation
n = 3 | ||
k = 2 | ||
|
||
Random.seed!(5) | ||
n = 4 | ||
k = 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please reset.
x, _, _ = Boscia.solve(f, grad!, lmo, verbose=true) | ||
x, _, _ = Boscia.solve(f, grad!, lmo, verbose=true, lazy=false, variant=Boscia.DICG()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to have both variants here. Also, it can function as a nice example for using DICG
.
|
||
param_mu = 0.4 | ||
param_lambda = 0.1 | ||
|
||
linVector = CSV.read("./data/qp_linVector.csv", DataFrame; header = false) |> Matrix | ||
lapMatrix = CSV.read("./data/qp_lapMatrix.csv", DataFrame; header = false) |> Matrix | ||
rrMatrix = CSV.read("./data/qp_rrMatrix.csv", DataFrame; header = false) |> Matrix | ||
A = lapMatrix + param_mu * rrMatrix | ||
@show size(A) | ||
b = param_lambda * linVector | ||
|
||
function f(x) | ||
|
||
return (1 / 2) * (transpose(x) * A * x) + sum(transpose(b) * x) | ||
end | ||
|
||
function grad!(storage, x) | ||
@. storage = $(A * x) + b | ||
end | ||
|
||
return f, grad! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent.
seed = rand(UInt64) | ||
@show seed | ||
Random.seed!(seed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please comment if not needed so the whole test suite runs with the same seed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a nice additional example in Boscia. Please redo it in the classical example format. It is enough if we have one Boscia run using DICG.
src/blmo_interface.jl
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you added dummies for the other DICG methods also?
src/polytope_blmos.jl
Outdated
# Otherwise, assgin one to the entry corresponding to the smallest entry of d. | ||
# Same for the UnitSimplex and ProbabilitySimplex. | ||
function bounded_dicg_maximum_step(sblmo::CubeSimpleBLMO, x, direction, lb, ub, int_vars; kwargs...) | ||
return FrankWolfe.dicg_maximum_step(FrankWolfe.ZeroOneHypercube(), x, direction) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In our case, the hypercube does not necessarily correspond to the Zero One hypercube!
src/polytope_blmos.jl
Outdated
end | ||
|
||
function bounded_dicg_maximum_step(sblmo::ProbabilitySimplexSimpleBLMO, x, direction, lb, ub, int_vars; kwargs...) | ||
return FrankWolfe.dicg_maximum_step(FrankWolfe.ProbabilitySimplexOracle{Float64}(), x, direction) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to give the Probability Simplex the correct right side. Aka N
in our case.
src/polytope_blmos.jl
Outdated
|
||
|
||
function bounded_dicg_maximum_step(sblmo::UnitSimplexSimpleBLMO, x, direction, lb, ub, int_vars; kwargs...) | ||
return FrankWolfe.dicg_maximum_step(FrankWolfe.UnitSimplexOracle{Float64}(), x, direction) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember the right side!
test/simple_test_ODWB.jl
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this. I have written an example in the example folder.
In terms of formatting, you have a lot of large indents. Please only use one tab, e.g.
|
Modified code in frank_wolfe_variants.jl, Boscia.jl, node.jl, polytope_blmos.jl, time_tracking_lmo.jl, managed_blmo.jl.
All changed or added code is wrapped by
#=========================#
......
#=========================#