From 5dce6c63ee67fa4f0f38c02ce2774ed89d19eb87 Mon Sep 17 00:00:00 2001 From: Niklas Heim Date: Fri, 16 Oct 2020 10:26:12 +0200 Subject: [PATCH] Fix scalar getindex in GenerativeModels.jl (#40) --- Project.toml | 2 +- src/batch_mvnormal.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 5c42849..6255f3c 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ConditionalDists" uuid = "c648c4dd-c1e0-49a6-84b9-144ae7fd2468" authors = ["Niklas Heim "] -version = "0.4.3" +version = "0.4.4" [deps] ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" diff --git a/src/batch_mvnormal.jl b/src/batch_mvnormal.jl index 2536232..00d8660 100644 --- a/src/batch_mvnormal.jl +++ b/src/batch_mvnormal.jl @@ -36,5 +36,5 @@ function Distributions.logpdf(d::BMN, x::AbstractMatrix{T}) where T<:Real n = size(d.μ,1) μ = mean(d) σ2 = var(d) - -(vec(sum(((x - μ).^2) ./ σ2 .+ log.(σ2), dims=1)) .+ n*log(T(2π))) / 2 + -(vec(sum(((x - μ).^2) ./ σ2 .+ log.(σ2), dims=1)) .+ n*log(T(2π))) ./ 2 end