如何用MLP神经网络解决XOR问题? [英] How to solve XOR problem with MLP neural network?

查看:295
本文介绍了如何用MLP神经网络解决XOR问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

明天早上我必须给神经网络做期末考试,但是有一个问题,我无法用MLP解决XOR问题,我不知道如何分配权重和偏差值:(

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 :(

推荐答案

所以,正如您在两天前发布的消息一样,我想为您的考试提供帮助的时间很晚:(

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!

通常,我会告诉您使用一个网络,该网络包含2个输入单元(每个布尔值一个),2个隐藏单元和1个输出单元(对于布尔值的回答),然后将您引向<有关反向传播学习算法的href ="http://en.wikipedia.org/wiki/Backpropagation" rel ="noreferrer">维基百科文章,以找到正确的权重.

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.

但是,您的措辞-我无法解决",听起来就像您的老师希望您自己找到权重.在这种情况下,一种解决方案是将一个隐藏单元视为一个或"门,而另一个隐藏单元表示一个与"门.从这些单元到输出的连接将使您说如果或"门触发而与"门不触发,则触发",这是XOR门的定义.无论如何,这只是直觉,实际的网络如下所示.

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.

请注意,图中某些单元的阈值通常不为0,这只是将偏置单元连接到以阈值为权重的那些单元的简写.

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.

这篇关于如何用MLP神经网络解决XOR问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆