神经网络

From Ufldl

Jump to: navigation, search
(神经网络模型)
(神经网络模型)
Line 40: Line 40:
-
我们用 <math>\textstyle {n}_l</math> 来表示网络的层数,本例中 <math>\textstyle n_l=3</math> ,我们将第 <math>\textstyle l</math> 层记为 <math>\textstyle L_l</math> ,于是 <math>\textstyle L_1</math> 是输入层,输出层是 <math>\textstyle L_{n_l}</math> 。本例神经网络有参数 <math>\textstyle (W,b) = (W^{(1)}, b^{(1)}, W^{(2)}, b^{(2)})</math> ,其中 <math>\textstyle W^{(l)}_{ij}</math> 第 <math>\textstyle l</math> 层第 <math>\textstyle j</math> 单元与第 <math>\textstyle l+1</math> 层第 <math>\textstyle i</math> 单元之间的联接参数(其实就是连接线上的权重,注意标号顺序), <math>\textstyle b^{(l)}_i</math> 是第 <math>\textstyle l+1</math> 层第 <math>\textstyle i</math> 单元的偏置项。因此,本例中, <math>\textstyle W^{(1)} \in \Re^{3\times 3}</math> , <math>\textstyle W^{(2)} \in \Re^{1\times 3}</math> 。注意,没有其他单元连向偏置单元(即偏置单元没有输入),因为它们总是输出+1。同时,我们用 <math>\textstyle s_l</math> 表示第 <math>\textstyle l</math> 层的节点数(偏置单元不计在内)。
+
我们用 <math>\textstyle {n}_l</math> 来表示网络的层数,本例中 <math>\textstyle n_l=3</math> ,我们将第 <math>\textstyle l</math> 层记为 <math>\textstyle L_l</math> ,于是 <math>\textstyle L_1</math> 是输入层,输出层是 <math>\textstyle L_{n_l}</math> 。本例神经网络有参数 <math>\textstyle (W,b) = (W^{(1)}, b^{(1)}, W^{(2)}, b^{(2)})</math> ,其中 <math>\textstyle W^{(l)}_{ij}</math> 第 <math>\textstyle l</math> 层第 <math>\textstyle j</math> 单元与第 <math>\textstyle l+1</math> 层第 <math>\textstyle i</math> 单元之间的联接参数(其实就是连接线上的权重,注意标号顺序), <math>\textstyle b^{(l)}_i</math> 是第 <math>\textstyle l+1</math> 层第 <math>\textstyle i</math> 单元的偏置项。因此在本例中, <math>\textstyle W^{(1)} \in \Re^{3\times 3}</math> , <math>\textstyle W^{(2)} \in \Re^{1\times 3}</math> 。注意,没有其他单元连向偏置单元(即偏置单元没有输入),因为它们总是输出+1。同时,我们用 <math>\textstyle s_l</math> 表示第 <math>\textstyle l</math> 层的节点数(偏置单元不计在内)。
-
我们用 <math>\textstyle a^{(l)}_i</math> 表示第 <math>\textstyle l</math> 层第 <math>\textstyle i</math> 号单元的'''激活值'''(输出值)。当 <math>\textstyle l=1</math> 时, <math>\textstyle a^{(1)}_i = x_i</math> ,也就是第 <math>\textstyle i</math> 个输入值(输入值的第 <math>\textstyle i</math> 个特征)。对于给定参数集合 <math>\textstyle W,b</math> ,我们的神经网络就按照函数 <math>\textstyle h_{W,b}(x)</math> 计算输出结果。本例神经网络的计算过程就由以下步骤表示:
+
我们用 <math>\textstyle a^{(l)}_i</math> 表示第 <math>\textstyle l</math> 层第 <math>\textstyle i</math> 单元的'''激活值'''(输出值)。当 <math>\textstyle l=1</math> 时, <math>\textstyle a^{(1)}_i = x_i</math> ,也就是第 <math>\textstyle i</math> 个输入值(输入值的第 <math>\textstyle i</math> 个特征)。对于给定参数集合 <math>\textstyle W,b</math> ,我们的神经网络就可以按照函数 <math>\textstyle h_{W,b}(x)</math> 计算输出结果。本例神经网络的计算步骤如下:
:<math>  
:<math>  
Line 76: Line 76:
-
目前为止,我们讨论了一种神经网络的例子,但我们也可以构建一个另一种'''结构'''的神经网络(这里结构指的是神经元之间的联接模式),包括具有多个隐藏层的神经网络。最常见的一个例子是 <math>\textstyle  n_l</math> 层的神经网络,第 <math>\textstyle  1</math> 层是输入层,第 <math>\textstyle  n_l</math> 层是输出层,中间的每个层 <math>\textstyle  l</math> 与层 <math>\textstyle  l+1</math> 紧密相联。这种模式下,要计算神经网络的输出结果,我们可以通过之前的等式描述的那样,按部就班,进行正向传播,逐一计算第 <math>\textstyle  L_2</math> 层的所有激活值,再者是第 <math>\textstyle  L_3</math> 层的激活值,以此类推,直到第 <math>\textstyle  L_{n_l}</math> 层。这是一个'''前馈'''神经网络的样例,因为这种联接图并没有闭环或回路。
+
目前为止,我们讨论了一种神经网络,我们也可以构建另一种'''结构'''的神经网络(这里结构指的是神经元之间的联接模式),也就是包括多个隐藏层的神经网络。最常见的一个例子是 <math>\textstyle  n_l</math> 层的神经网络,第 <math>\textstyle  1</math> 层是输入层,第 <math>\textstyle  n_l</math> 层是输出层,中间的每个层 <math>\textstyle  l</math> 与层 <math>\textstyle  l+1</math> 紧密相联。这种模式下,要计算神经网络的输出结果,我们可以按照之前描述的等式,按部就班,进行正向传播,逐一计算第 <math>\textstyle  L_2</math> 层的所有激活值,然后是第 <math>\textstyle  L_3</math> 层的激活值,以此类推,直到第 <math>\textstyle  L_{n_l}</math> 层。这是一个'''前馈'''神经网络的例子,因为这种联接图没有闭环或回路。
-
神经网络也可以有多个输出单元。比如,以下神经网络有两层隐藏层: <math>\textstyle L_2</math>  及 <math>\textstyle L_3</math> ,并在 <math>\textstyle L_4</math> 层中有两个输出单元。
+
神经网络也可以有多个输出单元。比如,下面的神经网络有两层隐藏层: <math>\textstyle L_2</math>  及 <math>\textstyle L_3</math> ,输出层 <math>\textstyle L_4</math> 有两个输出单元。
[[Image:Network3322.png|500px|center]]
[[Image:Network3322.png|500px|center]]
-
要求解这样的神经网络,需要样本集  <math>\textstyle (x^{(i)}, y^{(i)})</math>  ,其中 <math>\textstyle y^{(i)} \in \Re^2</math> 。如果你想预测的输出是多个的,那这种神经网络是很适用的。(比如,在医疗诊断应用中,患者的体征指标就可以作为向量的输入值,而不同的输出值 <math>\textstyle y_i</math> 可以表示不同的疾病存在与否。)
+
要求解这样的神经网络,需要样本集  <math>\textstyle (x^{(i)}, y^{(i)})</math>  ,其中 <math>\textstyle y^{(i)} \in \Re^2</math> 。如果你想预测的输出是多个的,那这种神经网络很适用。(比如,在医疗诊断应用中,患者的体征指标就可以作为向量的输入值,而不同的输出值 <math>\textstyle y_i</math> 可以表示不同的疾病存在与否。)
==中英语对照==
==中英语对照==

Revision as of 03:34, 14 March 2013

Personal tools