KeyError: "BlockAutoregressive object expected to find key in intermediates cache but didn't"

Hi,

I would like to compute the log probability of my variational density for some specific values in the y space (given the autoregressive flow transformation x–>y). The values I would like to check the log_prob for are not generated by the transformation. When I try to input them into the log_prob() I get:
KeyError: “BlockAutoregressive object expected to find key in intermediates cache but didn’t”

Is there a way to compute the log_prob() of a variational density using “external” values?

Thanks in advance!

Hi @dodi56, some Pyro transforms do not implement arbitrary inverse methods, even though they could in principle, because they may be expensive or complicated and are not necessary in typical variational inference applications. From the BlockAutoregressive docs:

The inverse operation is not implemented. This would require numerical inversion, e.g., using a root finding method - a possibility for a future implementation.

There was also another recent forum thread on the same question. As stated there, we do not plan on adding this functionality, so unfortunately you would have to do so yourself.

@eb8680_2 Thanks for the answer!