Comments (4)
Amazing, thanks for the quick fix @cscherrer .
from measuretheory.jl.
Thanks for the detailed description! We definitely need to get this one straightened out. I'll have a look now, not sure yet if it will be a quick fix or require refactoring.
from measuretheory.jl.
Just some notes...
I'm getting d
to be
For{Normal{(:μ, :σ), Tuple{Float64, Float64}}}((x, y)->Main.Normal(x, y),
([0.888615, 0.546949, 0.480678], [0.324695, 0.232562, 0.34126]))
which is probably just differences in type inference across Julia versions. We use Core.Compiler.return_type
to help figure out the element type. The result is used for acceleration and shouldn't affect the values (if it does it's a bug).
Then, note that logdensity_def
works just fine:
julia> x = rand(d)
3-element Vector{Float64}:
0.9987010201210617
0.8059743752497901
0.693856750735474
julia> logdensity_def(d, x)
-0.8728541665838293
The problem really comes up in iterating through basemeasure
s:
julia> basemeasure(d)
0.06349 * For{Union{}}(#13, ([0.888615, 0.546949, 0.480678], [0.324695, 0.232562, 0.34126]))
julia> basemeasure(ans)
For{Union{}}(#13, ([0.888615, 0.546949, 0.480678], [0.324695, 0.232562, 0.34126]))
julia> basemeasure(ans)
ERROR: MethodError: no method matching (::MeasureTheory.var"#13#14"{For{Normal{(:μ, :σ), Tuple{Float64, Float64}}, var"#9#10", Tuple{Vector{Float64}, Vector{Float64}}}})(::Float64, ::Float64)
Closest candidates are:
(::MeasureTheory.var"#13#14")(::Any) at ~/git/MeasureTheory.jl/src/combinators/for.jl:121
Stacktrace:
[1] basemeasure(d::For{Union{}, MeasureTheory.var"#13#14"{For{Normal{(:μ, :σ), Tuple{Float64, Float64}}, var"#9#10", Tuple{Vector{Float64}, Vector{Float64}}}}, Tuple{Vector{Float64}, Vector{Float64}}})
@ MeasureTheory ~/git/MeasureTheory.jl/src/combinators/for.jl:100
[2] top-level scope
@ REPL[23]:1
from measuretheory.jl.
It seems to be an issue with splatting. The fix is to change this code in for.jl
base = For(d.inds) do j
basemeasure(d.f(j)).base
end
to
f(args...) = basemeasure(d.f(args...)).base
base = For(f, d.inds...)
from measuretheory.jl.
Related Issues (20)
- Don't export `ifelse`? HOT 5
- Support ChangesOfVariables.with_logabsdet_jacobian for transformations HOT 6
- `testvalue(::MvNormal)` fails HOT 1
- Zenodo integration and DOI'd version for paper HOT 2
- WARNING: both MeasureTheory and TransformVariables export "as"; uses of it in module Main must be qualified HOT 2
- Change `bind` to `compound`? HOT 2
- Scaled canonical gaussian likelihoods HOT 5
- Scaled canonical quadratic likelihoods (#228) should support fusion
- Add methods for `logdensity_def(::Normal, ::Normal, x)`
- Goals for 0.19.0
- Making `smf` ForwardDiff-friendly HOT 2
- `logdensityof(::For, x)` slower than it should be HOT 3
- `For` transports HOT 1
- MvNormal is unintuitive and has performance issues relative to Distributions.jl
- Error when calling `rand` on a product measure HOT 3
- sum of random variable and deterministic value? HOT 2
- MeasureTheory was moved under JuliaMath
- MethodError for `quantile(Poisson(x), p)`
- Bump Static.jl compat HOT 1
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 measuretheory.jl.