-
Notifications
You must be signed in to change notification settings - Fork 17
New interface for SDDP #142
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
Conversation
Add generic interface for quadratic regularization
@@ -4,3 +4,5 @@ Distributions | |||
ProgressMeter | |||
Interpolations | |||
Iterators | |||
CutPruners |
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.
We need to register the Packages or at least give instruction to install
(verbose > 0) && println("Initial value function loaded into memory.") | ||
function solve_SDDP(model::SPModel, param::SDDPparameters, verbose=0::Int64; | ||
stopcrit::AbstractStoppingCriterion=IterLimit(20), | ||
prunalgo::AbstractCutPruningAlgo=CutPruners.AvgCutPruningAlgo(-1), |
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 CutPruningAlgo is an independent package we should keep a way of doing no cut pruning without calling this package.
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 are right
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 don't want to put CutPruners in the REQUIRE file ?
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 that we should keep CutPruners in REQUIRE, and register this package in METADATA.
In my previous answer, I rather mean that I have to change the default argument prunalgo
in solve_SDDP
so as to perform no cuts pruning by default.
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 I am a new user I might find disturbing to find that I need to install a new package (CutPruners) even if I don't want to use it.
I have to find out if there is a way to check if a package is installed and load and use it in this case without having it in REQUIRE. Same thing apply to plot packages.
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.
Ok after some reading (e.g. JuliaLang/julia#6195) the feature I want is not ready yet. Some workaround exists but are not really useful as of now if the other package in REQUIRE are in METADATA.jl
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 could use eval
to check whether a module is installed react depending on this but this does not work anymore on Julia v0.6 since JuliaLang/julia#265 has been merged (see e.g. JuliaOpt/MathProgBase.jl#150).
println("SDDP CONVERGENCE") | ||
@printf("- Exact lower bound: %.4e [Gap < %.2f%s]\n", | ||
lwb, 100*(upb+tol-lwb)/lwb, '%') | ||
@printf("- Estimation of upper-bound: %.4e\n", upb) | ||
@printf("- Upper-bound's s.t.d: %.4e\n", σ) | ||
@printf("- Confidence interval (%d%s): [%.4e , %.4e]", | ||
100*(1- 2*(1-param.confidence_level)), '\%',upb-tol, upb+tol) | ||
println("\n############################################################") | ||
println("\n", "#"^60) | ||
end | ||
end | ||
|
||
|
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.
Precise when the function is called, e.g. between two iterations of sddp
using MathProgBase, JuMP, Distributions | ||
using MathProgBase, JuMP, Distributions, StochasticDualDynamicProgramming | ||
using DocStringExtensions | ||
using CutPruners |
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 CutPruners is independant we should try to have a mechanism to be able to use the package without it
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.
Looks good to me :)
**Warning: ** these two packages are currently unregistered in julia's METADATA