Skip to content

Instantly share code, notes, and snippets.

@AyishaR
Created March 27, 2021 10:39
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 AyishaR/2344f6c7de13339ed29bed4d60a2078b to your computer and use it in GitHub Desktop.
Save AyishaR/2344f6c7de13339ed29bed4d60a2078b to your computer and use it in GitHub Desktop.
model = models.Sequential([
layers.Dense(1024, activation = 'relu', input_shape = Xtrain[0].shape),
layers.Dense(512, activation = 'relu'),
layers.Dense(256, activation = 'relu'),
layers.Dense(64, activation = 'relu'),
layers.Dense(16, activation = 'relu'),
layers.Dense(1)
])
cb = callbacks.EarlyStopping(patience = 20, restore_best_weights = True)
model.compile(optimizer = optimizers.Adam(0.00001), loss = losses.MeanSquaredError(), metrics = ['mae'])
history = model.fit(Xtrain, ytrain, validation_data = (Xval, yval), epochs = 256, callbacks = cb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment