CamDavidsonPilon / Probabilistic-Programming-and-Bayesian-Methods-for-Hackers

aka "Bayesian Methods for Hackers": An introduction to Bayesian methods + probabilistic programming with a computation/understanding-first, mathematics-second point of view. All in pure Python ;)
http://camdavidsonpilon.github.io/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/
MIT License
26.51k stars 7.84k forks source link

TFP versions | working with seeds #436

Open Pindar777 opened 5 years ago

Pindar777 commented 5 years ago

Hi @matthew-mcateer,

I tried to modify the code in order to get stable results. By doing so I came across this 'feature':

`intSeed = 12345 generate = tfd.Normal(0, 1)

1. try

evaluate(generate.sample(2, seed=intSeed)) # always: array([0.88424665, 0.07843047], dtype=float32)

2. try (intension to make code more readable

test = generate.sample(2, seed=intSeed) evaluate(test) # setting the seed does not work at all! ` IMHO using 'test' should not have this behavior. Do I miss something?

Thanks in advance