Skip to content

Instantly share code, notes, and snippets.

@AyishaR
Created April 30, 2021 14:53
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
model = models.Sequential([
layers.Dense(128, activation = 'relu', input_shape = Xtrain[0].shape),
layers.Dense(64, activation = 'relu'),
#layers.Dense(16, activation = 'relu'),
layers.Dense(8, activation = 'relu'),
layers.Dense(1)
])
cb = callbacks.EarlyStopping(patience = 10, restore_best_weights = True)
model.compile(optimizer = optimizers.Adam(0.001), loss = losses.MeanSquaredError(), metrics = ['mae'])
history = model.fit(Xtrain, ytrain, validation_data = (Xval, yval), epochs = 1024, callbacks = cb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment