aicenter / ConditionalDists.jl

Conditional probability distributions powered by DistributionsAD.jl
MIT License
21 stars 4 forks source link

Update README #29

Closed vitskvara closed 4 years ago

vitskvara commented 4 years ago

README example is not up-to-date with the latest interface,

julia> logpdf(cpdf, X, Z)
ERROR: DimensionMismatch("A has dimensions (2,3) but B has dimensions (2,10)")
Stacktrace:
 [1] gemm_wrapper!(::Array{Float32,2}, ::Char, ::Char, ::Array{Float32,2}, ::Array{Float32,2}, ::LinearAlgebra.MulAddMul{true,true,Bool,Bool}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/LinearAlgebra/src/matmul.jl:569
 [2] mul! at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/LinearAlgebra/src/matmul.jl:169 [inlined]
 [3] mul! at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/LinearAlgebra/src/matmul.jl:208 [inlined]
 [4] * at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/LinearAlgebra/src/matmul.jl:160 [inlined]
 [5] (::Dense{typeof(identity),Array{Float32,2},Array{Float32,1}})(::Array{Float32,2}) at /home/vit/.julia/packages/Flux/Fj3bt/src/layers/basic.jl:122
 [6] Dense at /home/vit/.julia/packages/Flux/Fj3bt/src/layers/basic.jl:133 [inlined]
 [7] mean at /home/vit/.julia/dev/ConditionalDists/src/cmean_gaussian.jl:52 [inlined]
 [8] mean_var at /home/vit/.julia/dev/ConditionalDists/src/cmean_gaussian.jl:67 [inlined]
 [9] _logpdf(::CMeanGaussian{DiagVar,Dense{typeof(identity),Array{Float32,2},Array{Float32,1}},Array{Float32,1}}, ::Array{Float32,2}, ::Array{Float32,2}) at /home/vit/.julia/dev/ConditionalDists/src/abstract_cgaussian.jl:20
 [10] logpdf(::CMeanGaussian{DiagVar,Dense{typeof(identity),Array{Float32,2},Array{Float32,1}},Array{Float32,1}}, ::Array{Float32,2}, ::Array{Float32,2}) at /home/vit/.julia/dev/ConditionalDists/src/abstract_cgaussian.jl:28
 [11] top-level scope at REPL[16]:1
vitskvara commented 4 years ago

Actually there only seems to be a mixup in the order of the arguments, so I'll fix it.

vitskvara commented 4 years ago

Fixed with https://github.com/aicenter/ConditionalDists.jl/commit/1ec0cdc606d1f60a6d57b710815227745bf1ccb8