当我添加数据增强时,我很困惑,是否应该获得更多的数据或测试我的x_train长度来确认的相同数据,但是我在增强之前获得了相同的长度,而在增强之后是否正确,还是应该得到数据的两倍?
print(len(x_train)) output : 5484增强后:
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那是好的还是我该做的?
发布于 2023-04-21 05:09:33
回复有点晚,但可能会对某人有帮助。
您不应该担心增强后的数据长度,因为当您将数据发送到培训时,keras会这样做。因此,实际数据长度不会改变。
https://datascience.stackexchange.com/questions/110434
复制相似问题