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

Improve documentation for risk measures, including Wasserstein #812

Closed
Tangtry opened this issue Jan 11, 2025 · 3 comments · Fixed by #813
Closed

Improve documentation for risk measures, including Wasserstein #812

Tangtry opened this issue Jan 11, 2025 · 3 comments · Fixed by #813

Comments

@Tangtry
Copy link

Tangtry commented Jan 11, 2025

I tried the Wasserstein risk measure using the hydro-thermal example from introductory file. The codes are as follows
SDDP.train(
model,
risk_measure = SDDP.Wasserstein(Gurobi.Optimizer; alpha=0.1) do x,y
return abs(x-y)
end,
iteration_limit = 10
)
However, it fails with an output

caused by: MethodError: no method matching -(::SDDP.Noise{Float64}, ::SDDP.Noise{Float64})
The function - exists, but no method is defined for this combination of argument types.

I also tried other risk measures like Entropy and ModifiedChiSquared, these work good.

@odow
Copy link
Owner

odow commented Jan 11, 2025

I haven't really used this since I added it. I guess it needs better docs!

From the error message, it looks like you might need:

risk_measure = SDDP.Wasserstein(Gurobi.Optimizer; alpha=0.1) do x, y
    return abs(x.term - y.term)
end

@odow odow changed the title How to train a model with the Wasserstein risk measure Improve documentation for risk measure, including Wasserstein Jan 11, 2025
@odow odow changed the title Improve documentation for risk measure, including Wasserstein Improve documentation for risk measures, including Wasserstein Jan 11, 2025
@Tangtry
Copy link
Author

Tangtry commented Jan 11, 2025

Thanks a lot! It works smoothly with the updated code.

@Tangtry Tangtry closed this as completed Jan 11, 2025
@odow odow reopened this Jan 11, 2025
@odow
Copy link
Owner

odow commented Jan 11, 2025

I'll leave this issue open until I fix the documentation properly 😄

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

Successfully merging a pull request may close this issue.

2 participants