Skip to content

Commit

Permalink
normal
Browse files Browse the repository at this point in the history
  • Loading branch information
PoorvaGarg committed Oct 25, 2024
1 parent 1cd9ae5 commit c647786
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions examples/sample/normal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ using Distributions

# with observe
bits = 2
pieces = 2^(bits + 4)
DFiP = DistFix{6 + bits, bits}
pieces = 2^(bits + 1)
DFiP = DistFix{4 + bits, bits}
code = @dice begin
w1 = bitblast(DFiP, Normal(0, sqrt(2)), pieces, -8.0, 8.0)
observe(prob_equals(w1.mantissa.number.bits[5+bits:6+bits], [true, false]))
observe(prob_equals(w1.mantissa.number.bits[3+bits:4+bits], [true, false]))
w1
end
p1 = pr(code)
Expand All @@ -19,11 +19,11 @@ plot(p1)
# without observe
bits = 0
pieces = 2^(bits + 3)
DFiP = DistFix{6 + bits, bits}
DFiP = DistFix{4 + bits, bits}
code = @dice begin
w1 = bitblast_sample(DFiP, Normal(0, sqrt(2)), pieces, -8.0, 8.0, 0.5, 0.25)
# observe(prob_equals(w1.mantissa.number.bits[5+bits:6+bits], [true, true]))
DistFix{8, 2}([w1.mantissa.number.bits..., true, false])
DistFix{6, 2}([w1.mantissa.number.bits..., true, false])
end
p2 = pr(code)
plot!(p2)
Expand Down

0 comments on commit c647786

Please sign in to comment.