首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >数据增强Keras数据长度

数据增强Keras数据长度
EN

Data Science用户
提问于 2022-04-28 00:35:25
回答 1查看 67关注 0票数 0

当我添加数据增强时,我很困惑,是否应该获得更多的数据或测试我的x_train长度来确认的相同数据,但是我在增强之前获得了相同的长度,而在增强之后是否正确,还是应该得到数据的两倍?

代码语言:javascript
复制
print(len(x_train)) output : 5484

增强后:

代码语言:javascript
复制
datagen = ImageDataGenerator(
        featurewise_center=True,  # set input mean to 0 over the dataset
        samplewise_center=True,  # set each sample mean to 0
        featurewise_std_normalization=True,  # divide inputs by std of the dataset
        samplewise_std_normalization=True,  # divide each input by its std
        zca_whitening=False,  # apply ZCA whitening
        rotation_range=45,  # randomly rotate images in the range (degrees, 0 to 180)
        zoom_range = 0.2, # Randomly zoom image 
        width_shift_range=0.2,  # randomly shift images horizontally (fraction of total width)
        height_shift_range=0.2,  # randomly shift images vertically (fraction of total height)
        horizontal_flip=True,  # randomly flip images
        vertical_flip=True,
        validation_split=0.2)  # randomly flip images
datagen.fit(x_train)
print(len(x_train)) output : 5484

那是好的还是我该做的?

EN

回答 1

Data Science用户

发布于 2023-04-21 05:09:33

回复有点晚,但可能会对某人有帮助。

您不应该担心增强后的数据长度,因为当您将数据发送到培训时,keras会这样做。因此,实际数据长度不会改变。

票数 0
EN
页面原文内容由Data Science提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://datascience.stackexchange.com/questions/110434

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档