Skip to content

Commit d82d3a0

Browse files
committed
rewrite naive_bayes using product_distribution
1 parent ab5ece2 commit d82d3a0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

models/dppl_naive_bayes.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ image = transform(pca, image_raw)
1616
# Take only the first 1000 images and vectorise
1717
N = 1000
1818
image_subset = image[:, 1:N]'
19-
image_vec = vec(image_subset[:, :])
19+
image_vec = image_subset[:, :]
2020
labels = labels[1:N]
2121

2222
@model function dppl_naive_bayes(image_vec, labels, C, D)
2323
m ~ product_distribution(fill(Normal(0, 10), C, D))
24-
image_vec ~ MvNormal(vec(m[labels, :]), I)
24+
image_vec ~ product_distribution(Normal.(m[labels, :]))
2525
end
2626

2727
model = dppl_naive_bayes(image_vec, labels, C, D)

0 commit comments

Comments
 (0)