-
Notifications
You must be signed in to change notification settings - Fork 4
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
Pseudo-branching #190
base: main
Are you sure you want to change the base?
Pseudo-branching #190
Conversation
…the similarl named examples already existing
…g. Current version runs on the two examples however it only uses MOST_INFEASIBLE, i.e. costs have not stabilized.
…et. I.e. this is more like a non sorted collections of potential sections
|
||
n = 6 | ||
|
||
const diffw = 0.5 * ones(n) |
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.
For testing, this is fine. Just beware that in this case all possible nodes will be created and evaluated because any vertex of the hypercube is optimal. The diffw
from the approx planted point example might be the better choice.
examples/portfolio_pseudocost.jl
Outdated
heu = Boscia.Heuristic((tree, blmo, x) -> Boscia.follow_gradient_heuristic(tree,blmo,x, depth), 0.2, :follow_gradient) | ||
heuristics = [heu] | ||
# heuristics = [] | ||
iterations_stable = 3::Int# how many times until we consider a pseudocost as stable |
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.
The ::Int
should not be necessary.
src/pseudo_branching.jl
Outdated
branching::PSEUDO_COST{BLMO} | ||
) where BLMO <: BoundedLinearMinimizationOracle | ||
@assert !isempty(node.active_set) | ||
active_set = copy(node.active_set) |
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.
If you are emptying the active set anyway, you can just create an empty one: https://github.com/ZIB-IOL/FrankWolfe.jl/blob/9009acab5d397d71cedee6156977d7d92f79b0b6/src/active_set.jl#L27
The active sets can be come quite large and copying them might lead to some unnecessary overhead.
… from approx planted example, also added a \mu for a potential branching score function
…rt. Current version runs but on the HiGHS_example with diffw = Random.rand(Bool, n) * 0.6 .+ 0.3 it does not change strategy before solving the problem.
…pseudocost branching
…seudocost branch.
…alling optimize. Before having them in get_branching_variable caused them to be reset on every call which made a strategy switch impossible
…he instance generated)
Modify tree
This version seems to work. It has been tested on the sparse_regression example where occasionaly decisions are made based on pseudocosts. I have yet to observe an instance where after some time all decisions are made on pseudocost knowledge, i.e. some variables don´t meet the requirement even after other variables have been branched on tens of times. Requirement for testing was that a variable has been branched up and down at least once. On the Approximate planted point example current code does not work yet when CubeSimpleBLMO is passed. Test Summary: | Pass Error Total Time |
…w updates to be made scaled to unit cost. Previously this was done incorrectly
…ates are scaled. the previous version scaled updates incorrectly resulting in only Inf value updates.
…it is even created
hierarchical pseudobranching strategy
…anching related ones to a new script called branchings_strategies.jl
src/branching_strategies.jl
Outdated
#println("\npd made\n") | ||
if branching.decision_function == "weighted_sum" | ||
#println(branching.decision_function) | ||
branching_scores = map(idx-> ((1 - branching.μ) * min((pseudos[idx, 1] - 1) * (values[idx] - floor(values[idx])), (pseudos[idx, 2] - 1) * (ceil(values[idx]) - values[idx])) + branching.μ * max((pseudos[idx, 1] - 1) * (values[idx] - floor(values[idx])), (pseudos[idx, 2] - 1) * (ceil(values[idx]) - values[idx]))), |
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 contract this a bit. Maybe put some things in separate functions. Currently, it is hard to read and understand what's going.
It would also be nice to have some examples and tests to check that the new branching strategies work as intended and showcase their usefulness. |
Only for hierarchy so far to test if it will still work.
…into the branching strategy which now is a mutable structure
No description provided.