Thank you! You are great.
Your code works well.
I got two question after this.


When I use SGD the loss goes down to 0.5 but it’s down to 0.2 if I use ADAM as you did.
I learned that the Binary Cross Entropy cost function is convex.
So It should goes down to global minimum.
But It stuck at some point(0.5) do you have any idea?


When I implemented as the lecture in Corsera machine learning ex02, I got loss 0.2 very quickly saying 400 epoch. But I saw even when I use Adam optimizer, It takes over 10000 epoch to 0.2 loss. The two code - in pytorch, in octave - looks having same logic tho. I’m confused 


Thank you again