Skip to content

Instantly share code, notes, and snippets.

@sameerg07
Created July 11, 2018 06:32
Show Gist options
  • Save sameerg07/8e688d9f76a01348cef51fd297d83832 to your computer and use it in GitHub Desktop.
Save sameerg07/8e688d9f76a01348cef51fd297d83832 to your computer and use it in GitHub Desktop.
Keras simple model
model = Sequential()
model.add(Dense(32, activation='relu', input_dim=100))
model.add(Dense(1, activation='sigmoid'))
model.compile(optimizer='rmsprop',
loss='binary_crossentropy',
metrics=['accuracy'])
# Generate dummy data
import numpy as np
data = np.random.random((1000, 100))
labels = np.random.randint(2, size=(1000, 1))
# Train the model, iterating on the data in batches of 32 samples
model.fit(data, labels, epochs=10, batch_size=32)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment