Skip to content

Commit

Permalink
2024-02-08 17:56:16
Browse files Browse the repository at this point in the history
  • Loading branch information
wizardforcel committed Feb 8, 2024
1 parent 49ff0fb commit 84fe060
Show file tree
Hide file tree
Showing 2 changed files with 572 additions and 2 deletions.
27 changes: 27 additions & 0 deletions totrans/dl-scr_3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -355,22 +355,26 @@
id: totrans-43
prefs: []
type: TYPE_NORMAL
zh: 为了明确连接,[图3-3](#fig_03-03)显示了前一章中的神经网络的图表,其中将单独的操作分组到层中。
- en: '![Neural net diagram](assets/dlfs_0303.png)'
id: totrans-44
prefs: []
type: TYPE_IMG
zh: '![神经网络图表](assets/dlfs_0303.png)'
- en: Figure 3-3\. The neural network from the prior chapter with the operations grouped
into layers
id: totrans-45
prefs:
- PREF_H6
type: TYPE_NORMAL
zh: 图3-3。前一章中的神经网络,操作分组成层
- en: You can see that the input represents an “input” layer, the next three operations
(ending with the `sigmoid` function) represent the next layer, and the last two
operations represent the last layer.
id: totrans-46
prefs: []
type: TYPE_NORMAL
zh: 您可以看到输入表示“输入”层,接下来的三个操作(以“sigmoid”函数结束)表示下一层,最后两个操作表示最后一层。
- en: 'This is, of course, rather cumbersome. And that’s the point: representing neural
networks as a series of individual operations, while showing clearly how neural
networks work and how to train them, is too “low level” for anything more complicated
Expand All @@ -379,20 +383,24 @@
id: totrans-47
prefs: []
type: TYPE_NORMAL
zh: 当然,这相当繁琐。这就是问题所在:将神经网络表示为一系列单独的操作,同时清楚地显示神经网络的工作原理以及如何训练它们,对于比两层神经网络更复杂的任何东西来说都太“低级”。这就是为什么更常见的表示神经网络的方式是以层为单位,如[图3-4](#fig_03-04)所示。
- en: '![Neural net diagram](assets/dlfs_0304.png)'
id: totrans-48
prefs: []
type: TYPE_IMG
zh: '![神经网络图表](assets/dlfs_0304.png)'
- en: Figure 3-4\. The neural network from the prior chapter in terms of layers
id: totrans-49
prefs:
- PREF_H6
type: TYPE_NORMAL
zh: 图3-4。以层为单位的前一章中的神经网络
- en: Connection to the brain
id: totrans-50
prefs:
- PREF_H3
type: TYPE_NORMAL
zh: 与大脑的连接
- en: 'Finally, let’s make one last connection between what we’ve seen so far and
a notion you’ve likely heard before: each layer can be said to have a certain
number of *neurons* equal to *the dimensionality of the vector that represents
Expand All @@ -402,6 +410,7 @@
id: totrans-51
prefs: []
type: TYPE_NORMAL
zh: 最后,让我们将我们迄今所见的内容与您可能之前听过的概念之间建立最后一个连接:每个层可以说具有等于*表示该层输出中每个观察的向量的维度*的*神经元*数量。因此,前一个示例中的神经网络可以被认为在输入层有13个神经元,然后在隐藏层中有13个神经元(再次),在输出层中有一个神经元。
- en: 'Neurons in the brain have the property that they can receive inputs from many
other neurons and will “fire” and send a signal forward only if the signals they
receive cumulatively reach a certain “activation energy.” Neurons in the context
Expand All @@ -413,54 +422,64 @@
id: totrans-52
prefs: []
type: TYPE_NORMAL
zh: 大脑中的神经元具有这样的特性,它们可以从许多其他神经元接收输入,只有当它们累积接收到的信号达到一定的“激活能量”时,它们才会“发射”并向前发送信号。神经网络的神经元具有类似的属性:它们确实根据其输入向前发送信号,但是输入仅通过非线性函数转换为输出。因此,这个非线性函数被称为*激活函数*,从中出来的值被称为该层的*激活*。^([1](ch03.html#idm45732624417528))
- en: 'Now that we’ve defined layers, we can state the more conventional definition
of deep learning: *deep learning models are neural networks with more than one
hidden layer.*'
id: totrans-53
prefs: []
type: TYPE_NORMAL
zh: 现在我们已经定义了层,我们可以陈述更传统的深度学习定义:*深度学习模型是具有多个隐藏层的神经网络。*
- en: We can see that this is equivalent to the earlier definition that was purely
in terms of `Operation`s, since a layer is just a series of `Operation`s with
a nonlinear operation at the end.
id: totrans-54
prefs: []
type: TYPE_NORMAL
zh: 我们可以看到,这等同于早期纯粹基于“操作”定义的定义,因为层只是一系列具有非线性操作的“操作”,最后是一个非线性操作。
- en: Now that we’ve defined a base class for our `Operation`s, let’s show how it
can serve as the fundamental building block of the models we saw in the prior
chapter.
id: totrans-55
prefs: []
type: TYPE_NORMAL
zh: 现在我们已经为我们的“操作”定义了一个基类,让我们展示它如何可以作为我们在前一章中看到的模型的基本构建模块。
- en: Building Blocks on Building Blocks
id: totrans-56
prefs:
- PREF_H1
type: TYPE_NORMAL
zh: 构建模块上的构建模块
- en: 'What specific `Operation`s do we need to implement for the models in the prior
chapter to work? Based on our experience of implementing that neural network step
by step, we know there are three kinds:'
id: totrans-57
prefs: []
type: TYPE_NORMAL
zh: 我们需要为前一章中的模型实现哪些特定的“操作”?根据我们逐步实现神经网络的经验,我们知道有三种:
- en: The matrix multiplication of the input with the matrix of parameters
id: totrans-58
prefs:
- PREF_UL
type: TYPE_NORMAL
zh: 输入与参数矩阵的矩阵乘法
- en: The addition of a bias term
id: totrans-59
prefs:
- PREF_UL
type: TYPE_NORMAL
zh: 添加偏置项
- en: The `sigmoid` activation function
id: totrans-60
prefs:
- PREF_UL
type: TYPE_NORMAL
zh: “sigmoid”激活函数
- en: 'Let’s start with the `WeightMultiply` `Operation`:'
id: totrans-61
prefs: []
type: TYPE_NORMAL
zh: 让我们从“WeightMultiply”“操作”开始:
- en: '[PRE2]'
id: totrans-62
prefs: []
Expand All @@ -474,10 +493,12 @@
id: totrans-63
prefs: []
type: TYPE_NORMAL
zh: 在前向传递中,我们简单地编码矩阵乘法,以及在反向传递中“向输入和参数发送梯度”的规则(使用我们在[第1章](ch01.html#foundations)末尾推理出的规则)。很快您将看到,我们现在可以将其用作我们可以简单插入到我们的“层”中的*构建模块*。
- en: 'Next up is the addition operation, which we’ll call `BiasAdd`:'
id: totrans-64
prefs: []
type: TYPE_NORMAL
zh: 接下来是加法操作,我们将其称为“BiasAdd”:
- en: '[PRE3]'
id: totrans-65
prefs: []
Expand All @@ -487,6 +508,7 @@
id: totrans-66
prefs: []
type: TYPE_NORMAL
zh: 最后,让我们做“sigmoid”:
- en: '[PRE4]'
id: totrans-67
prefs: []
Expand All @@ -496,16 +518,19 @@
id: totrans-68
prefs: []
type: TYPE_NORMAL
zh: 这只是实现了前一章描述的数学。
- en: Note
id: totrans-69
prefs:
- PREF_H6
type: TYPE_NORMAL
zh: 注意
- en: 'For both `sigmoid` and the `ParamOperation`, the step during the backward pass
where we compute:'
id: totrans-70
prefs: []
type: TYPE_NORMAL
zh: 对于“sigmoid”和“ParamOperation”,在反向传播期间计算的步骤是:
- en: '[PRE5]'
id: totrans-71
prefs: []
Expand All @@ -516,6 +541,7 @@
id: totrans-72
prefs: []
type: TYPE_NORMAL
zh: 是我们应用链规则的步骤,以及“WeightMultiply”的相应规则:
- en: '[PRE6]'
id: totrans-73
prefs: []
Expand All @@ -526,6 +552,7 @@
id: totrans-74
prefs: []
type: TYPE_NORMAL
zh: 正如我在[第1章](ch01.html#foundations)中所说的,当涉及的函数是矩阵乘法时,这相当于链规则的类比。
- en: Now that we’ve defined these `Operation`s precisely, we can use *them* as building
blocks to define a `Layer`.
id: totrans-75
Expand Down
Loading

0 comments on commit 84fe060

Please sign in to comment.