How to use keras for XOR

前端 未结 3 913
终归单人心
终归单人心 2021-01-05 15:57

I want to practice keras by code a xor, but the result is not right, the followed is my code, thanks for everybody to help me.

from keras.models import Seque         


        
3条回答
  •  醉酒成梦
    2021-01-05 16:20

    I used a single hidden layer with 4 hidden nodes, and it almost always converges to the right answer within 500 epochs. I used sigmoid activations.

提交回复
热议问题