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

查看:36
本文介绍了如何用 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 :(

推荐答案

所以,看到你在 2 天前发布了这个,我想我来帮助你考试有点晚了:(

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 个输出单元(用于布尔值答案)的网络来回答这个问题,然后将您引向 维基百科关于反向传播学习算法的文章,以找到正确的权重.

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.

但是,您的措辞——我无法解决"听起来像是您的老师希望您自己找到权重.在这种情况下,一种解决方案是将一个隐藏单元视为代表或门,另一个代表与门.从这些单元到输出的连接将允许您说如果 OR 门触发而 AND 门不触发则触发",这是 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天全站免登陆