Skip to content
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

Central Path Cutting Plane #755

Open
FSchmidtDIW opened this issue Jul 1, 2024 · 2 comments
Open

Central Path Cutting Plane #755

FSchmidtDIW opened this issue Jul 1, 2024 · 2 comments

Comments

@FSchmidtDIW
Copy link

Hi Oscar,

I was wondering if anyone has implemented the Central Path Cutting Plane algorithm based on Chebyshev centres by Beltran et al. for SDDP.jl. I was going to have a go at a new ForwardPass but wanted to make sure that it is not implemented anywhere yet.

Thanks a lot

Felix

@odow
Copy link
Owner

odow commented Jul 13, 2024

I have not implemented it. All code for SDDP.jl is contained in this repo.

@odow
Copy link
Owner

odow commented Oct 11, 2024

Hi @FSchmidtDIW, how'd you get on?

Here's a place that might be useful to start

mutable struct RegularizedForwardPass{T<:AbstractForwardPass} <:
AbstractForwardPass
forward_pass::T
trial_centre::Dict{Symbol,Float64}
ρ::Float64
function RegularizedForwardPass(;
rho::Float64 = 0.05,
forward_pass::AbstractForwardPass = DefaultForwardPass(),
)
centre = Dict{Symbol,Float64}()
return new{typeof(forward_pass)}(forward_pass, centre, rho)
end
end
function forward_pass(
model::PolicyGraph,
options::Options,
fp::RegularizedForwardPass,
)
if length(model.root_children) != 1
error(
"RegularizedForwardPass cannot be applied because first-stage is " *
"not deterministic",
)
end
node = model[model.root_children[1].term]
if length(node.noise_terms) > 1
error(
"RegularizedForwardPass cannot be applied because first-stage is " *
"not deterministic",
)
end
old_bounds = Dict{Symbol,Tuple{Float64,Float64}}()
for (k, v) in node.states
if has_lower_bound(v.out) && has_upper_bound(v.out)
old_bounds[k] = (l, u) = (lower_bound(v.out), upper_bound(v.out))
x = get(fp.trial_centre, k, model.initial_root_state[k])
set_lower_bound(v.out, max(l, x - fp.ρ * (u - l)))
set_upper_bound(v.out, min(u, x + fp.ρ * (u - l)))
end
end
pass = forward_pass(model, options, fp.forward_pass)
for (k, (l, u)) in old_bounds
fp.trial_centre[k] = pass.sampled_states[1][k]
set_lower_bound(node.states[k].out, l)
set_upper_bound(node.states[k].out, u)
end
return pass
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants