Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save saimadhu-polamuri/b6bbf6959d1e8905de3a837209680751 to your computer and use it in GitHub Desktop.
Save saimadhu-polamuri/b6bbf6959d1e8905de3a837209680751 to your computer and use it in GitHub Desktop.
# 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