In [1]:
from keras.models import Sequential
# For a single-input model with 2 classes (binary classification):

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)


Using Theano backend.
WARNING (theano.configdefaults): g++ not available, if using conda: `conda install m2w64-toolchain`
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-1-9c11feb3825f> in <module>()
      3 
      4 model = Sequential()
----> 5 model.add(Dense(32, activation='relu', input_dim=100))
      6 model.add(Dense(1, activation='sigmoid'))
      7 model.compile(optimizer='rmsprop',

NameError: name 'Dense' is not defined

In [ ]: