Skip to content

Instantly share code, notes, and snippets.

@afozbek
Created January 28, 2019 07:51
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 afozbek/52ba850c9f3a333cb9adf29218d05c44 to your computer and use it in GitHub Desktop.
Save afozbek/52ba850c9f3a333cb9adf29218d05c44 to your computer and use it in GitHub Desktop.
med
def create_model():
model = Sequential()
model.add(Dense(10, input_dim = num_pixels, #num_pixels: 784
activation = 'relu'))
model.add(Dense(30, activation='relu'))
model.add(Dense(10, activation='relu'))
model.add(Dense(num_of_classes, activation='softmax'))
model.compile(Adam(lr=0.01), #lr: learning rate
loss='categorical_crossentropy', #loss function
metrics=['accuracy'])
return model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment