How to solve XOR problem with MLP neural network?

心不动则不痛 提交于 2019-12-18 07:38:08

问题


Tomorrow morning I have to give neural network final exam, but there is a problem, I cannot solve XOR problem with MLP, I don't know how to assign weights and bias values :(


回答1:


So, seeing as you posted this 2 days ago, I guess I'm a lil late to help with your exam :(

However, learning is always a good thing, and learning about neural nets doubly so!

Normally I'd answer this question by telling you to use a network with 2 input units (one for each boolean), 2 hidden units, and 1 output unit (for the boolean answer), and then directing you towards the wikipedia article on the backprop learning algorithm to find the correct weights.

However, your phrasing -- "I cannot solve" makes it sound like your teacher wants you to find the weights yourself. In which case, a solution would be to think of one hidden unit as representing an OR gate and the other representing an AND gate. The connections from the those units to the output would allow you to say 'fire if the OR gate fires and the AND gate doesn't', which is the definition of the XOR gate. Anyways, that's just the intuition, the actual net is shown below.

Notice that the thresholds of some of the units in the diagram aren't 0 as they normally are -- this is just shorthand for having the bias unit connected to those units with the threshold as the weight.



来源:https://stackoverflow.com/questions/6495603/how-to-solve-xor-problem-with-mlp-neural-network

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!