Trouble building a NADE

Hello community,

I would like to create a simple NADE model with Tensorflow, only with a few dense layers, and applied to Mnist dataset.

Here is my (really untidy sketch of) model :

The idea is to predict the next pixel of a flattened image from the previous one. Concerning the maths behind, everything’s clear, it’s really with the coding that I am getting confused :sweat_smile: .

I sliced my inputs using tf.slice() in a for loop, then concatenate, to gather back everything in one layer. I am getting value errors from the slices that I do not understand.

Note : I introduced some approximations in the notebook for the debugging, even though I am sure it won’t work (to debug).

Maybe the error is obvious but I can’t see it :sweat_smile: thanks a lot for the help ! And also, making tidy work is really, pathologically hard for me, then thanks for helping make my question and work also clearer :slight_smile: I am really grateful for your patience

Have all a nice day !