当前位置:网站首页>深度学习训练多少轮?迭代多少次?
深度学习训练多少轮?迭代多少次?
2022-06-13 00:38:00 【程序媛珂珂】
深度学习是当今最火的研究方向之一。它以其卓越的学习能力,实现了AI的关键功能。一般来说,深度学习一次肯定是不够的,那么深度学习训练多少轮?迭代多少次?大家所关心的问题,解答来了。
深度学习训练迭代多少次?
翻了翻各位大牛的研究成果,有训练10个迭代的,有30个,甚至也有1万个以上的。这就让小白迷茫了,到底训练多少次合适?训练的检验标准是什么?
有一些大牛上来直接就说训练多少次,也不解释为什么,就说是凭经验,这种我们学不来。还有一些专家给出了一些理由,我们来总结一下。
01 当loss值收敛时结束迭代
深度学习的一个关键原理就是比较学习结果和样本标签之间的差距。理论上差距越小,表明学习的效果越好。这个差距就是loss值。
Loss值不可能变为0,只能无限逼近0。所以通过脚趾都能想到,当loss值无法变小的时候,这称为收敛,就是学习结束之时。比如像下图这样的:

02 使用验证集来检验训练成果
你以为就靠一个收敛就能解决一切问题吗?没那么简单。
深度学习常常会遇到一个问题——过拟合。训练的时候学习效果很好,但是拿到其它地方测试发现效果就不行了。
就是说,并不一定是学习效果最好的时候才停止。那如何来判断停止的时机呢?
有学者提出了验证集。
就是说,把训练集分为2部分,比如70%用来训练,30%用来验证。就像下面的代码。
X_train, X_test, y_train, y_test = train_test_split(X, Y, test_size=0.33, random_state=seed)
然后在训练时加入验证的参数,就像这样:
autoencoder.fit(train_data, train_data,
epochs=50,
batch_size=128,
shuffle=True,
validation_data=(noisy_imgs, data_test)
)然后就是观察验证曲线,什么时候验证的loss值最小,就选那一次的训练模型进行测试应用。
比如下图,上面是训练曲线,下面是验证曲线。学习15次的效果就已经比较好了。

03 使用测试集来检验训练成果
随着研究的广泛开展和对学习效果的极致追求,我们渐渐发现了一个问题——有时候从验证曲线看到的最优值并不是真实预测过程的最好效果。比如这种情况:对大尺度数据进行深度学习去噪。
先说结论:最优方法是通过测试效果来决定迭代的次数。
具体怎样做的呢?比如这样的案例:一张大的二维数据,比如300*300,像这样的:

免费分享一些我整理的人工智能学习资料给大家,包括一些AI常用框架实战视频、图像识别、OpenCV、NLQ、机器学习、pytorch、计算机视觉、深度学习与神经网络等视频、课件源码、国内外知名精华资源、AI热门论文、行业报告等。
为了更好的系统学习AI,推荐大家收藏一份。
下面是部分截图,文末附免费下载方式。
一、人工智能课程及项目

二、国内外知名精华资源

三、人工智能论文合集

四、人工智能行业报告

学好人工智能,要多看书,多动手,多实践,要想提高自己的水平,一定要学会沉下心来慢慢的系统学习,最终才能有所收获。
点击下方名片,扫码免费下载文中资料。
边栏推荐
猜你喜欢

Successfully installed opencv under delphixe

kotlin 协程withContext切换线程

Cve-2021-24078 vulnerability analysis

硬(磁)盘(二)

Download nail live playback through packet capturing

Using fastjson to solve the problem of returning an empty array from a null value of a field string object

Programming training 1

ROS2之OpenCV人脸识别foxy~galactic~humble

Kali system -- dnsmap for DNS collection and analysis

Masa auth - overall design from the user's perspective
随机推荐
Easyexcel read excel simple demo
[buglist] serial port programming does not read data
天津银行周传凯:从 0 到 1,我的分布式数据库落地经验谈
JPA execution failed in scheduled task -executing an update/delete query transactionrequiredexception
Why is there always a space (63 or 2048 sectors) in front of the first partition when partitioning a disk
Kalix system - use of information collection gadgets
Kali system -- host, dig, dnsenum, imtry for DNS collection and analysis
Card constructions -- two points
RCC clock configuration of stm32f401
Transaction verification of btcd transaction process (2)
How to determine whether T is a value type in a generic type or a reference class- How to determine whether T is a value type or reference class in generic?
Map from getting started to performance optimization
Kali system -- fierce of DNS collection and analysis
Andersen Global通过在芬兰和丹麦的合作协议拓展北欧地区业务版图
ucore lab3
Antdpro - protable realizes the linkage effect of two selection boxes
New blog address
Using fastjson to solve the problem of returning an empty array from a null value of a field string object
Build your own PE manually from winpe of ADK
也许尘埃落地,我们才能想清楚互联网的本质