Last active
July 10, 2018 20:04
-
-
Save anj-s/5c3396f3c33653c3b2a4b2a1cb0778f2 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
import tensorflow as tf | |
model = tf.keras.models.Sequential() | |
model.add(tf.keras.layers.Dense(32, activation='relu', input_dim=100)) | |
model.add(tf.keras.layers.Dense(1, activation='sigmoid')) | |
model.compile(optimizer=tf.keras.optimizers.Adadelta(rho=0.9), | |
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)S) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment