Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
d2l-zh
提交
5a7362b2
D
d2l-zh
项目概览
OpenDocCN
/
d2l-zh
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
d2l-zh
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5a7362b2
编写于
12月 19, 2018
作者:
A
Aston Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove train_with_data_aug(no_aug, no_aug)
上级
0b01bd83
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
3 addition
and
12 deletion
+3
-12
chapter_computer-vision/image-augmentation.md
chapter_computer-vision/image-augmentation.md
+3
-12
未找到文件。
chapter_computer-vision/image-augmentation.md
浏览文件 @
5a7362b2
...
...
@@ -228,25 +228,15 @@ def train_with_data_aug(train_augs, test_augs, lr=0.001):
loss = gloss.SoftmaxCrossEntropyLoss()
train_iter = load_cifar10(True, train_augs, batch_size)
test_iter = load_cifar10(False, test_augs, batch_size)
train(train_iter, test_iter, net, loss, trainer, ctx, num_epochs=
5
)
train(train_iter, test_iter, net, loss, trainer, ctx, num_epochs=
10
)
```
### 有关图像增广的对比实验
我们先观察使用了图像增广的结果。
下面使用随机左右翻转的图像增广来训练模型。
```
{.python .input n=39}
train_with_data_aug(flip_aug, no_aug)
```
作为对比,下面我们尝试不使用图像增广。
```
{.python .input n=40}
train_with_data_aug(no_aug, no_aug)
```
可以看到,即使添加了简单的随机翻转也可能对训练产生一定的影响。图像增广通常会使训练准确率变低,但有可能提高测试准确率。它可以用来应对过拟合。
## 小结
*
图像增广基于现有训练数据生成随机图像从而应对过拟合。
...
...
@@ -255,6 +245,7 @@ train_with_data_aug(no_aug, no_aug)
## 练习
*
不使用图像增广训练模型:
`train_with_data_aug(no_aug, no_aug)`
。比较有无图像增广时的训练和测试准确率。该对比实验是否能支持图像增广可以应对过拟合这一论断?为什么?
*
在基于CIFAR-10数据集的模型训练中增加不同的图像增广方法。观察实现结果。
*
查阅MXNet文档,Gluon的
`transforms`
模块还提供了哪些图像增广方法?
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录