Created
August 24, 2020 03:51
-
-
Save saimadhu-polamuri/b6bbf6959d1e8905de3a837209680751 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# importing libraries | |
import tensorflow as tf | |
import warnings | |
from mlxtend.plotting import plot_decision_regions | |
from tensorflow.keras.models import Sequential | |
from tensorflow.keras.layers import Dense | |
from sklearn.model_selection import train_test_split | |
x_train,x_test,y_train,y_test = train_test_split( | |
x, y, test_size=0.33,random_state=42) | |
model = Sequential() | |
model.add(Dense(500, input_dim=2, activation='relu')) | |
model.add(Dense(1, activation='sigmoid')) | |
model.compile(loss='binary_crossentropy', | |
optimizer='adam', | |
metrics=['accuracy']) | |
history = model.fit(x_train, y_train, | |
validation_data=(x_test, y_test), | |
epochs=4000, verbose=0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment