The problems seems to go away when I change the learning rate from 0.01 to 0.001. Does that tell you anything?
Now, since the code is finally running: The output returned is going to be floats, but since I need a classification of either 0 or 1 in the output, what should I do to obtain this? Do I need to do some kind of normalization, or should I apply some activation function in the last output layer - if so, which one?