Skip to content

Commit 027177b

Browse files
authored
Make PF state hashing consistent with equality.
1 parent 1f1bbd0 commit 027177b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/inference/particle_filter.jl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ function Base.:(==)(a::ParticleFilterState{U}, b::ParticleFilterState{V}) where
4040
a.parents == b.parents
4141
end
4242
function Base.hash(state::ParticleFilterState{U}, h::UInt) where {U}
43-
return hash(U,
44-
hash(state.traces,
45-
hash(state.log_weights .+ (state.log_ml_est - log(length(state.log_weights))),
46-
hash(state.parents,
47-
h))))
43+
return hash(U, hash(state.traces,
44+
hash(state.log_weights,
45+
hash(state.log_ml_est, hash(state.parents, h)))))
4846
end
4947

5048
"""

0 commit comments

Comments
 (0)