rll/deepul

Bug in MADE sampling implementation in 'hw1_solutions.ipynb'

Closed this issue · 1 comments

//Implementation provided in the notebook

bug

Suppose there are three variables x1,x2,x3 and the ordering given is 3,1,2 , then during sampling:
I)Desired sampling order should be x2,x3,x1
II)The above code sample in order x3,x1,x2

This bug is noticeable when random permutation is passed as ordering in function q2_b (passing ordering = None doesn't expose the bug):
model = MADE((1, H, W), 2, hidden_size=[512, 512],ordering = np.random.permutation(H*W)).cuda()

Result with the current bug on shape and MNIST samples (when ordering passed is random permutation)
shapebug
mnistbug

So the slide 38 of Lecture 2 also needs to be edited.Random permutation doesn't generate such bad samples as shown in slides.Its the bug in the code
https://docs.google.com/presentation/d/1xl4KKNYw08PatORSnFDyzX6MT98brEdYElZKZ5bi2YM/edit#slide=id.g7d02b18e4d_0_191

Suggested Fix code:
correct_code

Results with this code
shapes_correct
mnist_correct

Nice catch, thanks for letting us know about this! The homework solutions, demos, and slides should all be updated with the correct code / samples now