Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created November 17, 2020 06:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/dc66e381f0025fb92c55779dfcfae56e to your computer and use it in GitHub Desktop.
Save amankharwal/dc66e381f0025fb92c55779dfcfae56e to your computer and use it in GitHub Desktop.
model = Sequential()
model.add(Conv2D(32, (3, 3), padding = "same", activation='relu', input_shape=(124,124,3)))
model.add(Conv2D(64, (3, 3), activation='relu'))
model.add(Conv2D(128, (3, 3), activation='relu'))
model.add(MaxPooling2D(pool_size=(2,2)))
model.add(Dropout(0.25))
model.add(Flatten())
model.add(Dropout(0.5))
model.add(Dense(50, activation='relu'))
model.add(Dropout(0.5))
model.add(Dense(1, activation='sigmoid'))
model.compile(loss='binary_crossentropy', optimizer='adam' ,metrics=['accuracy'])
xtrain,xval,ytrain,yval=train_test_split(X, Y,train_size=0.8,random_state=0)
featurewise_center=False,
samplewise_center=False,
featurewise_std_normalization=False,
samplewise_std_normalization=False,
zca_whitening=False,
rotation_range=15,
width_shift_range=0.1,
height_shift_range=0.1,
horizontal_flip=True,
vertical_flip=False)
datagen.fit(xtrain)
history = model.fit_generator(datagen.flow(xtrain, ytrain, batch_size=32),
steps_per_epoch=xtrain.shape[0]//32,
epochs=50,
verbose=1,
validation_data=(xval, yval))
@aman977
Copy link

aman977 commented Feb 14, 2023

datagen = ImageDataGenerator(featurewise_center=...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment