bayesiains / nflows

Normalizing flows in PyTorch
MIT License
845 stars 118 forks source link

Context #68

Open jakubbober opened 1 year ago

jakubbober commented 1 year ago

What exactly is the context, for example in the distributions like MADEMoG? I wanted to use this distrubution instead of StandardNormal for the MaskedAutoregressiveFlow, but I keep getting the error 'NoneType' object has no attribute 'shape' when I want to sample from this flow due to the fact that the first dimension of samples is set to context.shape[0], but I don't specify the context. Could you provide an example on how to fix this, or how an example context should be provided?

forangel2014 commented 4 months ago

In my opinion, context is the condition of the base distribution which you want to fit. e.g. $N(\cdot|\mu(context), \Sigma(context))$. In the code, the context is used to generate params of the base distribution through context_encoder.