V
V
vovak19192019-11-01 11:11:04
Neural networks
vovak1919, 2019-11-01 11:11:04

What is the validation principle in ImageDataGenerator?

I made a generator from the directory (flow_from_directory) with the selection of validation data (validation_split=0.25). Based on it, there are two fillings: test (train_generator1) and verification (validation_generator1).

datagen1 = ImageDataGenerator(rescale=1./255, rotation_range=60, width_shift_range=0.2, height_shift_range=0.2, zoom_range=0.5, horizontal_flip=True, vertical_flip=True, validation_split=0.25)
train_generator1 = datagen1.flow_from_directory(directory=dir1, target_size=(150,150), batch_size=39, class_mode='sparse', save_to_dir=dir2_1, save_prefix=u'XXX', subset='training')
validation_generator1 = datagen1.flow_from_directory(directory=dir1, target_size=(150,150), batch_size=39, class_mode='sparse', save_to_dir=dir2_2, save_prefix=u'XXX', subset='validation')
history = model.fit_generator(train_gen, steps_per_epoch=156, validation_data=val_gen, validation_steps=52)

After going through the generator, I looked at the test directory and found that the test images were transformed in the same way as the training ones. Tell me, what is the principle of training? Should the test images transform too or remain static?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2019-11-01
@vovak1919

the test images were transformed in the same way as the training ones

But you created them on the basis datagen1of which you specified shifts, rotations, etc. In any case, this serves to increase the data sets, there is nothing wrong with that.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question