首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >BackPropagation神经元网络方法-设计

BackPropagation神经元网络方法-设计
EN

Stack Overflow用户
提问于 2015-12-19 23:57:32
回答 1查看 722关注 0票数 2

我正试着做一个数字识别程序。我将输入一个数字的白色/黑色图像,我的输出层将触发相应的数字(输出层中的0 -> 9神经元中将有一个神经元触发)。我完成了一个二维BackPropagation神经元网络的实现.我的拓扑大小是5 -> 3 -> 110,所以它是一个二维输入层,一个二维隐藏层和一个一维输出层.然而,我得到了奇怪和错误的结果(平均错误和输出值)。

在这个阶段进行调试有点费时。因此,我想知道这是否是正确的设计,所以我继续调试。下面是我实现的流程步骤:

  • 构建网络:除输出层外,每个层都有一个偏差(无偏差)。偏差的输出值总是= 1.0,但是它的连接权值在每次传递时都会被更新,就像网络中的所有其他神经元一样。所有重量范围0.000 -> 1.000 (无底片)
  • 获取输入数据(0 \ OR \ 1),并将第n个值设置为输入层中的第n个神经元输出值。
  • 前馈:在每个层(输入层除外)的每个神经元'n‘上:
代码语言:javascript
复制
- Get result of SUM (Output Value \* Connection Weight) of connected Neurons from previous layer towards this nth Neuron.
- Get TanHyperbolic - Transfer Function - of this SUM as Results
- Set Results as the Output Value of this nth Neuron

  • 获得结果:获取输出层中神经元的输出值
  • BackPropagation:
代码语言:javascript
复制
- Calculate Network Error: on the Output Layer, get SUM Neurons' (Target Values - Output Values)^2. Divide this SUM by the size of the Output Layer. Get its SquareRoot as Result. Compute Average Error = (OldAverageError \* SmoothingFactor \* Result) / (SmoothingFactor + 1.00)
- Calculate Output Layer Gradients: for each Output Neuron 'n', nth Gradient = (nth Target Value - nth Output Value) \* nth Output Value TanHyperbolic Derivative
- Calculate Hidden Layer Gradients: for each Neuron 'n', get SUM (TanHyperbolic Derivative of a weight going from this nth Neuron \* Gradient of the destination Neuron) as Results. Assign (Results \* this nth Output Value) as the Gradient.
- Update all Weights: Starting from the hidden Layer and back to the Input Layer, for nth Neuron: Compute NewDeltaWeight = (NetLearningRate \* nth Output Value \* nth Gradient + Momentum \* OldDeltaWeight). Then assign New Weight as (OldWeight + NewDeltaWeight)

  • 重复过程。

这是我对数字7的尝试。输出神经元# 0和神经元# 6。神经元6应该携带1,神经元#0应该携带0。在我的结果中,除6以外的所有神经元都带有相同的值(# 0是一个样本)。

很抱歉寄了这么长的邮筒。如果你知道这一点,那么你可能知道它有多酷,在一个帖子里有多大。提前谢谢你

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-12-20 00:34:14

具有日志丢失的Softmax通常用于多类输出层激活函数.您有多类/多项:包含10个类的10个可能的数字。

因此,您可以尝试将输出层激活函数更改为softmax。

函数

人工神经网络 在神经网络仿真中,通常将softmax函数实现在网络的最后一层进行分类。然后,在日志丢失(或交叉熵)的情况下对此类网络进行训练,给出多项式logistic回归的非线性变量。

让我们知道这会产生什么影响。-

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34376665

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档