Skip to content

Instantly share code, notes, and snippets.

@Praveenk8051
Last active May 6, 2020 12:23
Show Gist options
  • Save Praveenk8051/ce8b185737b2901a539c577fdaca3c31 to your computer and use it in GitHub Desktop.
Save Praveenk8051/ce8b185737b2901a539c577fdaca3c31 to your computer and use it in GitHub Desktop.
Dataaugment mnist
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