keras sequential model python code example
Example 1: keras.sequential
from keras.models import Sequential
from keras.layers import Dense, Activation
model = Sequential([
Dense(32, input_shape=(784,)),
Activation('relu'),
Dense(10),
Activation('softmax'),
])
Example 2: keras declare sequential model
from keras.models import Sequential
from keras.layers import Dense
model = Sequential()
model.add(Dense(2, input_dim=1))
model.add(Dense(1))
model2 = Sequential([Dense(2, input_dim=1), Dense(1)])
model2.add(Dense(1))