openai / iaf

Code for reproducing key results in the paper "Improving Variational Inference with Inverse Autoregressive Flow"
https://arxiv.org/abs/1606.04934
MIT License
518 stars 133 forks source link

Possible bug in the source #3

Open John-Jumper opened 7 years ago

John-Jumper commented 7 years ago

On line 373 and 374 of models.py, you have "if posterior_conv3 != None: modules.append(posterior_conv4)", which looks strongly like a bug based on the surrounding context. I might be mistaken since I have only started to look at the source, but I wanted to make you aware in case it is a bug. The context of these lines is below

361:    def postup(updates, w):
362-        modules = [up_conv1,up_conv2,down_conv1,down_conv2]
363-        if downsample and downsample_type == 'conv':
364-            modules += [up_conv3,down_conv3]
365-        if prior_conv1 != None:
366-            modules.append(prior_conv1)
367-        if posterior_conv1 != None:
368-            modules.append(posterior_conv1)
369-        if posterior_conv2 != None:
370-            modules.append(posterior_conv2)
371-        if posterior_conv3 != None:
372-            modules.append(posterior_conv3)
373-        if posterior_conv3 != None:
374-            modules.append(posterior_conv4)
375-        for m in modules:
376-            updates = m.postup(updates, w)