Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "AdvancedPS"
uuid = "576499cb-2369-40b2-a588-c64705576edc"
authors = ["TuringLang"]
version = "0.6"
version = "0.6.1"

[deps]
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
Expand Down
5 changes: 3 additions & 2 deletions src/rng.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ Base.rand(rng::TracedRNG, ::Type{T}) where {T} = Base.rand(rng.rng, T)
Split `key` into `n` new keys
"""
function split(key::Integer, n::Integer=1)
T = typeof(key) # Make sure the type of `key` is consistent on W32 and W64 systems.
return T[hash(key, i) for i in UInt(1):UInt(n)]
T = typeof(key)
inner_rng = Random.MersenneTwister(key)
return rand(inner_rng, T, n)
end

"""
Expand Down
4 changes: 3 additions & 1 deletion test/linear-gaussian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ end
@testset "linear-gaussian.jl" begin
T = 3
N_PARTICLES = 100
N_SAMPLES = 50
N_SAMPLES = 200
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to bump this to get the test to pass.


# Model dynamics
a = 0.5
Expand Down Expand Up @@ -100,12 +100,14 @@ end
@testset "PGAS" begin
pgas = AdvancedPS.PGAS(N_PARTICLES)
p = test_algorithm(rng, pgas, model, N_SAMPLES, Xf)
@info p
@test p > 0.05
end

@testset "PG" begin
pg = AdvancedPS.PG(N_PARTICLES)
p = test_algorithm(rng, pg, model, N_SAMPLES, Xf)
@info p
@test p > 0.05
end
end
Loading