Skip to content

Instantly share code, notes, and snippets.

@sagarhowal
Created December 25, 2017 10:47
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 sagarhowal/dc4c656995f11fbcf013d41c44caea2d to your computer and use it in GitHub Desktop.
Save sagarhowal/dc4c656995f11fbcf013d41c44caea2d to your computer and use it in GitHub Desktop.
ANN Design and Compiling
# Adding the input layer and the first hidden layer
classifier.add(Dense(units = 16, kernel_initializer = 'uniform', activation = 'relu', input_dim = 30))
# Adding the second hidden layer
classifier.add(Dense(units = 16, kernel_initializer = 'uniform', activation = 'relu'))
# Adding the output layer
classifier.add(Dense(units = 1, kernel_initializer = 'uniform', activation = 'sigmoid'))
# Compiling the ANN
classifier.compile(optimizer = 'adam', loss = 'binary_crossentropy', metrics = ['accuracy'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment