Simple example to understand plates and to_event with pyro.infer.SVI

For the example in this notebook, why are shift_mean and shift_std not going to 0 and 2?

Am I using the with pyro.panel and to_event correctly?

I re-wrote things here:

I’m interested in characterizing a noisy 1D signal that is shifted. How do I estimate the parameters of the shift random variable (which is different for each 1D observation, but comes from the same underlying distribution)?

Do you mean pyro.plate and .to_event()? I have never heard of Pyro panels or to_enumerate :confused:

Yes, that’s exactly what I mean… Sorry for using the Canadian terminology :wink:

I worked on this a bit more. Basically, I have this type of structure of problem.

Let’s say

  • I do know mu_shift, sigma_shift, and sigma_noise.
  • I want to estimate the posterior of shift_i for each i

How can I fully take advantage of the plate and vectorize things?

I coded up a more complicated version of the problem in the notebook pyro_1D_sigmasignal_shift.ipynb at my repo geoffwoollard/prob_prog/ (sorry having trouble including github link because of some error on this forum), but the link functions are shown explicitly

Hi @geoffwoollard,
(sorry about the forum link issues, it looks like discourse was flagging your links as spam; hopefully that won’t happen again now that I’ve approved them).

Your model looks good to me, but inference hasn’t converged. I’d try running for more steps (say 200 or 500), increasing learning rate (to say 0.02 or 0.05), and maybe increasing batch size.

Re: “TODO: what if we don’t know 0,2 here, we just use best guess”, this is just a Bayesian prior, so if you don’t know the data was generated from a Normal(0, 2), then simply use a noninformative prior like Normal(0, 100).