I got confused by the use of the binary cross entropy. In particular it wasn't clear to me why the variable real_labels are used in the training of the generator.
I have added some comments. I am not sure if they are correct, so you might want to double check them.