Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created November 12, 2020 06:58
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/474e060aaf0ca735d17564b24cc19905 to your computer and use it in GitHub Desktop.
Save amankharwal/474e060aaf0ca735d17564b24cc19905 to your computer and use it in GitHub Desktop.
model = Sequential()
model.add(Dense(16, activation='relu', input_shape=(3,)))
model.add(Dense(16, activation='relu'))
model.add(Dense(2, activation='softmax'))
model.compile(optimizer='SGD', loss='squared_hinge', metrics=['accuracy'])
model.fit(X_train, y_train, batch_size=10, epochs=20, verbose=1, validation_data=(X_test, y_test))
[test_loss, test_acc] = model.evaluate(X_test, y_test)
print("Evaluation result on Test Data : Loss = {}, accuracy = {}".format(test_loss, test_acc))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment