epoch如何设置,在Keras中,steps_per_epoch和纪元的设置如何影响训练结果?
My generator always yields two images from my dataset randomly and then I calculate the loss using this two samples. Say I set steps_per_epoch=40 and epochs=5, what's the difference if I set steps_per_epoch=5 and epochs=40 (I use Adam for my optimizer)?
解决方案
The epochs argument (also called iteration) refers to the number of full passes over the whole training data. The steps_per_epoch argument refers to the number of batches generated during one epoch. Therefore we have steps_per_epoch = n_samples / batch_size.
For example, if we have 1000 training samples and we set batch-size to 10 then we have steps_per_epoch = 1000 / 10 = 100. The epochs can be set regardless of the value of batch-size or steps_per_epoch.
There is no definite value of batch-size that works for all the scenarios. Usually, a very large batch-size slows down the training process (i.e. it takes more time for the model to converge to a solution) and a very small batch-size may not be a good use of available resources (i.e. GPU and CPU). The usual values include 32, 64, 128, 256, 512 (powers of 2 helps with faster GPU memory allocations). Also, here is an answer on SO that concerns this issue which includes citations of relevant books and papers. Or take a look at this question and its answers on Cross Validated for a more complete definition of batch-size.
epoch如何设置,在Keras中,steps_per_epoch和纪元的设置如何影响训练结果?相关推荐
- 是为计算机局域网内的用户设置的,电脑中怎么在局域网内设置打印机的共享
电脑中怎么在局域网内设置打印机的共享 在使用电脑的时候,如果想要在局域网中,共享使用某台打印机的话,因如何设置呢?接下来就由小编来告诉大家. 具体如下: 1. 第一步,打开电脑后,点击左下角的开始图标 ...
- 表格里怎么不显示excl服务器,表格里0不显示怎么设置_excel表格中0不显示的设置步骤-win7之家...
大家在编辑excel表格的时候,经常会输入数值0,然而有些用户有时候会想要设置excel数值为0不显示,但是却不知道要怎么下手,那么表格里0不显示怎么设置呢?方法有三种,接下来win7之家小编给大家讲 ...
- html5border设置彩色,css中border颜色不同怎么设置?
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言. css中bord ...
- html5复选框怎么设置样式,html中关于checkBox选中样式设置
例如外卖服务区域,选择时为多选,且一般隐藏checkbox样式框.只留下label字体和设置的外边框来进行选中样式控制,以此来提高用户体验. 这时要对checkbox进行处理 我总结的一个方法就是根据 ...
- 字体粗细怎么设置 html,html中字体的粗细怎么设置?字体大小是font-size,那粗细怎么设置的?...
满意答案 yanyuTan 2014.05.25 采纳率:59% 等级:10 已帮助:870人 利用CSS设置font-weight 属性, font-weight: normal : 默认值. ...
- 实现keras中ConvLSTM2D中recurrent_activation和activation的设置
LSTM结构如下图 一种常见的写法为如下,每个门的生成除了当前时刻的信息Xt和上一个时刻的输出ht-1外,还外加了一个小尾巴 Ct-1,即上一个时刻的状态. 但是这个写法其实太过复杂,而且不易理解LS ...
- keras中文文档_【DL项目实战02】图像识别分类——Keras框架+卷积神经网络CNN(使用VGGNet)
版权声明:小博主水平有限,希望大家多多指导. 目录: [使用传统DNN] BG大龍:[DL项目实战02]图像分类--Keras框架+使用传统神经网络DNNzhuanlan.zhihu.com [使用 ...
- 使用keras进行深度学习_如何在Keras中通过深度学习对蝴蝶进行分类
使用keras进行深度学习 A while ago I read an interesting blog post on the website of the Dutch organization V ...
- Python机器学习笔记:深入理解Keras中序贯模型和函数模型
先从sklearn说起吧,如果学习了sklearn的话,那么学习Keras相对来说比较容易.为什么这样说呢? 我们首先比较一下sklearn的机器学习大致使用流程和Keras的大致使用流程: skl ...
- keras中的回调函数
keras训练 fit(self, x, y, batch_size=32, nb_epoch=10, verbose=1, callbacks=[], validation_split=0.0, v ...
最新文章
- 如何成为Java程序员
- Delphi自定义过程获取本机ip,名字,用户名
- explain分析执行计划
- mysql数据库的优缺点
- synchronized 和Lock区别
- 2015 总结 2016 展望
- Python中过滤序列内置函数filter()的详解(常用)
- java 小数点保留_Java小数点位数保留
- [转]numpy 100道练习题
- TVS ESD 二极管介绍与应用
- 378.有序矩阵中第K小的元素
- RHadoop的技术性文章
- 影视处理计算机配置,影视后期制作电脑配置需要什么
- linux考试题100道
- [JavaSE] 二维数组详解【静态初始化和动态初始化区别】—Day13
- 【附源码】计算机毕业设计SSM小说阅读网站
- 一键解决word文档样式格式问题
- docker: 打包h5项目的镜像
- 数据库与Java语言之间的鹊桥——JDBC
- 第03章 Python的数据结构、函数和文件--Python for Data Analysis 2nd