Now let's proceed to data processing:
- We start by defining a generator for the training and testing data. We will use these generators while loading data into our environment and perform real-time data augmentation:
# train generatortrain_augmentor = image_data_generator( rescale = 1/255, rotation_range = 300, width_shift_range = 0.15, height_shift_range = 0.15, shear_range = 0.2, zoom_range = 0.2, horizontal_flip = TRUE, fill_mode = "nearest")# test generatortest_augmentor <- image_data_generator(rescale = 1/255)
Now let's load the training, testing, and validation data into our environment:
# load train datatrain_data <- flow_images_from_directory( train_path, train_augmentor, target_size = c(150, 150), batch_size ...