-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Problem Interface #35
Conversation
src/koopman.jl
Outdated
- quadalg: quadrature algorithm to use (default HCubatureJL()) | ||
- ireltol, iabstol: integration relative and absolute tolerances (default 1e-2, 1e-2) | ||
""" | ||
function solve(prob::ExpectationProblem, expalg::Koopman, args...; |
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.
DiffEqBase.
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.
can you elaborate?
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.
DiffEqBase.solve
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.
gotcha, thanks!
src/koopman.jl
Outdated
f0 = map(prob.f0_func, zip(_x,_p)) | ||
end | ||
|
||
fq .= Ug .* f0 |
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.
@ChrisRackauckas this causes HCubatureJL
to fail for nout=1
...if I switch the integrand to oop, it passes....
I dug into it, and it executes the exact same quadrature evaluation points and returning integrand values for both directly returning a scalar and in-place for a length=1
array. The quadrature alg seems to keep evaluating more points for the latter therefore returning a different value.
Any ideas?
FYI @agerlach
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.
HCubature will internally call different algorithms depending on if scalar bounds or array. This may explain it??? See hcubature vs hquadrature https://github.com/JuliaMath/HCubature.jl
So I cannot get I would imagine that the only reason the original tests pass is because the AD does not enter the bounds via the specific problem we are testing. On the bright side, |
HCubature should get a PR to fix this. I think we can merge without that, but the tests should be set to properly mark which are broken and which are not (and in the current setup that will require some conditionals) |
@aml5600 can you update the readme to reflect the interface change? Also, SciMLTutorials SciML/SciMLTutorials.jl#343 How does or will this interface work w/ convenience methods like |
AbstractUncertaintyProblem
abstract type andExpectationProblem
structsolve
methods forExpectationProblem
usingKoopman
andMonteCarlo
solve
and into problem constructionuncertainty_utils.jl
for helper functionsRelevant tests pass...The quadrature methods do not seem to work with
ForwardDiff
as the dual variables "enter" into the problem's lower/upper bounds. The construction of the problem should make it easy to setup for various problem types, this one should handle what I would like it to do at the moment!