Comments (10)
Thanks for the suggestion. I have tried it in the following way:
T = promote_type(typeof(lb),typeof(ub))
lb = convert(T,lb)
ub = convert(T,ub)
I receive the following:
ERROR: LoadError: StackOverflowError:
Stacktrace:
[1] cachedrule(#unused#::Type{ForwardDiff.Dual{ForwardDiff.Tag{var"#85#86", Float64}, Float64, 1}}, n::Int64) (repeats 79984 times)
@ QuadGK ~.julia\packages\QuadGK\czbUH\src\gausskronrod.jl:249
This is the same error as before. Using another method, e.g. HCubatureJL()
gives a different error. In this case, the Stacktrace leads back to the GaussKronrod method in the HCubature package with the following error
ERROR: LoadError: MethodError: no method matching kronrod(::Type{ForwardDiff.Dual{ForwardDiff.Tag{var"#109#110", Float64}, Float64, 1}}, ::Int64)
Closest candidates are:
kronrod(::Type{T}, ::Integer) where T<:AbstractFloat
from integrals.jl.
Any updates on this? I am also trying to get derivatives wrt. to differentiation boundaries using HCubatureJL() and get exactly the same error as @rseydam above.
It would be absolutely great if this was addressed!
I am also a Julia beginner, but maybe with some guide I could help?
from integrals.jl.
The place to put the derivative rule would be https://github.com/SciML/Quadrature.jl/blob/master/src/Quadrature.jl#L577-L635 . Indeed right now it doesn't do the derivative w.r.t. the upper bound.
from integrals.jl.
Hi, I have got the same problem. Is there a simple way to fix it? I think having the variable in the lower bound leads similarly to a StackOverflowError. Here is an example of this type of problem
using Quadrature
using ForwardDiff
##
function ftest2(x)
prob = QuadratureProblem( (I,p) -> x^2*I^2 , 0.0, x, [x] )
tmp2 = solve( prob, QuadGKJL(), reltol=1e-12, abstol=0 )[1]
return tmp2
end
ftest2(1.0)[1]
##
ForwardDiff.derivative(x -> ftest2(x)[1], 0.0)
from integrals.jl.
Someone probably just needs to do
https://github.com/SciML/Quadrature.jl/blob/master/src/Quadrature.jl#L170
T = promote_type(typeof(lb),typeof(ub))
and then convert both lb
and ub
to T
.
from integrals.jl.
Beginner here. I think I'm running into this sort of problem too (and I asked about it on discourse). I'm unclear: has this differentiation wrt limit of integration feature been added yet? thanks
from integrals.jl.
Any updates on this? I am also trying to get derivatives wrt. to differentiation boundaries using HCubatureJL() and get exactly the same error as @rseydam above. It would be absolutely great if this was addressed! I am also a Julia beginner, but maybe with some guide I could help?
Similar problem for me as well
from integrals.jl.
I am also a Julia beginner but interested in solving this problem. Any advice where to start? The links above seem outdated.
from integrals.jl.
Derivative overloads generally aren't the easiest project to get started with. I'd usually advise doing something easier first, like #194.
If you do want to help this effort though, I think the starting place is to help improve the tests, i.e. help us finish #196 which will highlight exactly what parts of the algorithms are not dealing with derivatives well. The actual derivative overloads are in https://github.com/SciML/Integrals.jl/blob/master/ext/IntegralsForwardDiffExt.jl and https://github.com/SciML/Integrals.jl/blob/master/ext/IntegralsZygoteExt.jl, the latter using ChainRules https://juliadiff.org/ChainRulesCore.jl/stable/
from integrals.jl.
as a quick solution: with e.g. FiniteDiff.finite_difference_jacobian()
you can differentiate w.r.t. the integral boundaries. Maybe that's helpful as a workaround
from integrals.jl.
Related Issues (20)
- Quadrature routines for pre-sampled data HOT 3
- It would be nice to have a `progress` keyword for time estimation HOT 7
- Improve docstrings
- Inconsistent IntegralsCubature Interface
- Example from the first tutorial is broken HOT 5
- Interface error for VEGAS from [email protected]
- Warp MCIntegration.jl
- Issue when Nesting Integrals without Explicit Floats
- Factor out MonteCarloIntegration.jl into extension package HOT 2
- BoundsError: attempt to access Float64 at index [2] when `pi` is passed as limit HOT 1
- Add tests
- Missing documentation for IntegralFunction and BatchIntegralFunction HOT 3
- HCubature does not work with ODESolution produced by some ODE solvers HOT 6
- Unhelpful error message when not importing the correct packages HOT 3
- nout > 1 for QuadGK HOT 1
- Use `alg` in `build_solution` rather than constructing a new algorithm HOT 1
- `IntegralProblem` keywords not passed to solvers
- Gauss-Turán Quadratures HOT 8
- Strange instalation or upgrade error HOT 2
- Integrating a vector valued out-of-place integrand returns a scalar HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from integrals.jl.