Hi,
I am trying to save the multivariate distribution generated by using variational inference. I tried to save in JLS format. But I am getting the following error:
ERROR: MethodError: no method matching write(::IOStream, ::Bijectors.TransformedDistribution{DistributionsAD.TuringDiagMvNormal{Array{Float64,1},Array{Float64,1}},Bijectors.Stacked{Tuple{Bijectors.Exp{0},Bijectors.Identity{0}},2},Multivariate})
The minimum working example is as below:
using Random
using Turing
using Turing: Variational
Random.seed!(42);
# generate data, n = 2000
x = randn(2000);
@model model(x) = begin
s ~ InverseGamma(2, 3)
m ~ Normal(0.0, sqrt(s))
for i = 1:length(x)
x[i] ~ Normal(m, sqrt(s))
end
end
# construct model
m = model(x);
# ADVI
advi = ADVI(10, 1000)
q = vi(m, advi);
#save
write("chain.jls", q)
If I am wrong, is there any other packages available to store multivariate distribution?
Thanks in Advance !
Manu