Skip to content

Commit

Permalink
Merge pull request #1838 from JuliaRobotics:24Q3/fix/unpackdist
Browse files Browse the repository at this point in the history
bug fix unpackDistr PackedZeroMeanFullNormal
  • Loading branch information
dehann authored Aug 13, 2024
2 parents c1e06fb + 5111a87 commit 03fb278
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Serialization/services/SerializingDistributions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ function unpackDistribution(dtr::PackedZeroMeanDiagNormal)
return MvNormal(LinearAlgebra.Diagonal(map(abs2, sqrt.(dtr.diag))))
end # sqrt.(dtr.diag)
function unpackDistribution(dtr::PackedZeroMeanFullNormal)
return MvNormal(reshape(dtr.cov, length(dtr.mu), :))
d = round(Int,sqrt(size(dtr.cov)[1]))
return MvNormal(reshape(dtr.cov, d, d))
end
unpackDistribution(dtr::PackedDiagNormal) = MvNormal(dtr.mu, sqrt.(dtr.diag))
function unpackDistribution(dtr::PackedFullNormal)
Expand Down

0 comments on commit 03fb278

Please sign in to comment.