diff --git a/src/recursive_bp_factor.jl b/src/recursive_bp_factor.jl index 3324aa2f..33fbceeb 100644 --- a/src/recursive_bp_factor.jl +++ b/src/recursive_bp_factor.jl @@ -22,7 +22,7 @@ prob_xy(wᵢ::RecursiveBPFactor, yₖ, xₖ, xᵢ, dᵢ) = prob_xy(wᵢ, yₖ, x "P(yₐᵦ|yₐ,yᵦ,xᵢᵗ)" prob_yy(wᵢ::RecursiveBPFactor, y, y1, y2, xᵢ, d1, d2) = prob_yy(wᵢ::RecursiveBPFactor, y, y1, y2, xᵢ) prob_yy(wᵢ::RecursiveBPFactor, y, y1, y2, xᵢ) = error("Not implemented") -prob_y0(wᵢ::RecursiveBPFactor, y, xᵢᵗ) = y == 1 +prob_y0(wᵢ::RecursiveBPFactor, y, xᵢᵗ)::Float64 = y == 1 ############################################## #### the next methods are optional @@ -124,10 +124,10 @@ function compute_prob_ys(wᵢ::Vector{U}, qi::Int, μin::Vector{M2}, ψout, T, s B, lz + lz1 + lz2, d1 + d2 end - Minit = [[float(prob_y0(wᵢ[t], y, xᵢ)) for _ in 1:1, - _ in 1:1, + Minit = [[prob_y0(wᵢ[t], y, xᵢ) for _ in 1:1, + _ in 1:1, y in 1:nstates(wᵢ[t],0), - xᵢ in 1:qi] + xᵢ in 1:qi] for t=1:T+1] init = (M2(Minit), 0.0, 0) dest, (full, logzᵢ,) = cavity(B, op, init)