pmelchior / scarlet-pixelcnn

2 stars 1 forks source link

Nans and wrong size of postage stamps #1

Closed EiffL closed 5 years ago

EiffL commented 5 years ago

I have pushed a module that takes the gradient of the pixel cnn model, and tried to interface it but it receives some nan in input for some reason, also it gets postage stamps of size 65 instead of 64. Not sure why.

pmelchior commented 5 years ago

OK. I made an experimental branch even_size of scarlet, which you need to pull for further tests. I also updated your notebook so that you can run with proper sizes. However, when I do that, I get this error: ValueError: Cannot feed value of shape (64, 64) for Tensor 'Placeholder_36:0', which has shape '(1, 64, 64, 1)' from this call grad = self.session.run(self.pixelcnn, feed_dict={self.x: X}). So something isn't right with the gradients.

In addition, I find the construction of the sources to be very slow, caused by repeated inits of PixelCNNConstraint. I think it's due to the placeholder self.x = tf.placeholder(shape=(1,64,64,1), dtype=tf.float32). Can this be sped up?

pmelchior commented 5 years ago

To clarify, you still need the even_size branch of scarlet, but then the proximal operator works. I saw it blow up after tens of iterations, though.