Last active
May 6, 2020 12:23
-
-
Save Praveenk8051/ce8b185737b2901a539c577fdaca3c31 to your computer and use it in GitHub Desktop.
Dataaugment mnist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
datagen = ImageDataGenerator( | |
featurewise_center=False, | |
samplewise_center=False, | |
featurewise_std_normalization=False, | |
samplewise_std_normalization=False, | |
zca_whitening=False, | |
rotation_range=10, # randomly rotate images | |
zoom_range = 0.2, # Randomly zoom image | |
width_shift_range=0.2, # randomly shift images horizontally | |
height_shift_range=0.2, # randomly shift images vertically | |
horizontal_flip=False, # randomly flip images | |
vertical_flip=False) # randomly flip images | |
datagen.fit(X_train) | |
monitor_model = model.fit_generator(datagen.flow(X_train,Y_train, batch_size=batch_size), | |
epochs = epochs, validation_data = (X_val,Y_val), | |
verbose = 2, steps_per_epoch=X_train.shape[0] // batch_size | |
, callbacks=[learning_rate_reduction]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment