Sample from the Deep Markov Model (DMM)

I’m able to run the tutorial code and train the model ( It’s not obvious how I can generate samples from the trained model though. I tried to call dmm.model() with a test sequence (mini_batch of size 1, and set up the length and mask accordingly). The later half of the input sequence was set to all 0, and I’d like to see if the model can “fill” the empty slots. But I got exactly the same thing back. What’s the right way to sample from the model, both conditionally and unconditionally?

the way the model is currently set up the pyro.sample statement on line 212 takes a fixed obs keyword which clamps the sample to the observed data. so if you remove that obs keyword, the sample statement will in fact draw a sample. if you collect those samples you have a sampled sequence of x’s. so that’s how you would draw unconditionally from the model.

drawing from the model conditionally is a bit more complicated. that’s because doing so would require using both the model and the guide. basically you use the guide to consume the sequence you’d like to condition on. then, at that point, you pass control over to the model, making sure that the first z_prev seen by the model is the final z sampled by the guide. if you have trouble getting this to work, i suggest you paste a code snippet that demonstrates your approach, and we can offer more concrete advice.

We are looking into the same problem. Did anybody implment this yet or have an outline on how to process? Thanks!


Same here.
Any new conclusions?