本教程的神经网络隐藏层输入大小

时间:2017-04-08 19:30:06

标签: machine-learning neural-network artificial-intelligence

我正在关注本教程的第5部分,可以在此链接中找到:http://peterroelants.github.io/posts/neural_network_implementation_part05/

这创建了一个适用于识别0-9手写数字的神经网络。

在本教程的中间,作者解释说神经网络有64个输入(代表64像素图像),其中包含两个输入大小为20的隐藏神经网络。(见下面的截图)

enter image description here

我有两个问题:

1)任何人都可以解释将64输入层投影到20输入层的选择吗?为什么选择20?它是武断的还是通过实验确定的?有一个直观的原因吗?

2)为什么有两个隐藏层?我在某处读到大多数问题都可以通过1-2个隐藏层来解决,而这通常是通过反复试验来确定的。这是同样的情况吗?

欣赏任何想法

1 个答案:

答案 0 :(得分:1)

The network has:

  • one input layer with 64 neurons --> one for each pixel
  • a hidden layer with 20 neurons
  • another hidden layer with 20 neurons
  • an output layer with 10 neurons --> one for each digit

The choice of two hidden layers with 20 neurons each is relatively arbitrary, and probably determined by experiment, just as you said. Also, the description of each of these layers as another network can be confusing/misleading. You are also right on account of 1-2 hidden layers usually being sufficient for problems, and with digit recognition, which is not to complex, this is the case.