Created
July 11, 2018 06:32
-
-
Save sameerg07/8e688d9f76a01348cef51fd297d83832 to your computer and use it in GitHub Desktop.
Keras simple model
This file contains hidden or 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
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