训练多层感知器时,历元和迭代的区别是什么?


当前回答

通常,你会把你的测试集分成小批,让网络从中学习,并让训练在你的层数中一步一步地进行,一直应用梯度下降。所有这些小步骤都可以称为迭代。

一个epoch对应于整个训练集通过整个网络一次。限制这种情况是很有用的,例如对抗过拟合。

其他回答

Epoch和iteration描述的是不同的东西。


时代

epoch描述了算法看到整个数据集的次数。因此,每当算法看到数据集中的所有样本时,就完成了一个epoch。

迭代

迭代描述了一批数据通过算法的次数。在神经网络的例子中,这意味着向前传递和向后传递。因此,每当你通过神经网络传递一批数据时,你就完成了一次迭代。


例子

举个例子可能会更清楚。

假设您有一个包含10个示例(或样本)的数据集。批处理大小为2,并指定算法运行3个epoch。

因此,在每个epoch中,您有5个批次(10/2 = 5)。每个批次都通过算法,因此每个epoch有5个迭代。 因为您已经指定了3个epoch,所以总共有15个迭代(5*3 = 15)用于训练。

时代 对整个数据集进行完整的训练,使得每个 例子已经见过一次了。因此,一个epoch表示N/batch 大小训练迭代,其中N是的总数 的例子。 迭代 在训练过程中对模型权重的一次更新。 迭代包括计算参数的梯度 对于单批数据的损失。

奖金:

批处理 在一次迭代中使用的示例集(即一个梯度) 更新)的模型训练。 请参见批大小。

来源:https://developers.google.com/machine-learning/glossary/

一个epoch包含几个迭代。这就是这个时代。让我们把epoch定义为训练神经网络时在数据集上的迭代次数。

通常,你会把你的测试集分成小批,让网络从中学习,并让训练在你的层数中一步一步地进行,一直应用梯度下降。所有这些小步骤都可以称为迭代。

一个epoch对应于整个训练集通过整个网络一次。限制这种情况是很有用的,例如对抗过拟合。

我想在神经网络术语的背景下:

Epoch:当你的网络最终遍历整个训练集(即,每个训练实例一次)时,它完成了一个Epoch。

为了定义迭代(也就是步骤),你首先需要知道批处理的大小:

Batch Size: You probably wouldn't like to process the entire training instances all at one forward pass as it is inefficient and needs a huge deal of memory. So what is commonly done is splitting up training instances into subsets (i.e., batches), performing one pass over the selected subset (i.e., batch), and then optimizing the network through backpropagation. The number of training instances within a subset (i.e., batch) is called batch_size. Iteration: (a.k.a training steps) You know that your network has to go over all training instances in one pass in order to complete one epoch. But wait! when you are splitting up your training instances into batches, that means you can only process one batch (a subset of training instances) in one forward pass, so what about the other batches? This is where the term Iteration comes into play: Definition: The number of forwarding passes (The number of batches that you have created) that your network has to do in order to complete one epoch (i.e., going over all training instances) is called Iteration.

例如,当你有10,000个训练实例,你想用10的大小进行批处理;你必须进行10,000/10 = 1,000次迭代才能完成1个epoch。

希望这能回答你的问题!