Open woneuy01 opened 4 years ago
ppt
Instantiate a Sequential model. Add a Dense layer of 50 neurons with an input shape of 1 neuron. Add two Dense layers of 50 neurons each and 'relu' activation. End your model with a Dense layer with a single neuron and no activation.
model = Sequential()
model.add(Dense(50, input_shape=(1,), activation='relu'))
model.add(Dense(50,input_shape=(50,), activation='relu')) model.add(Dense(50,input_shape=(50,), activation='relu'))
model.add(Dense(1))
Import the Sequential model and Dense layer from keras.models import Sequential from keras.layers import Dense
Create a Sequential model model = Sequential()
Add an input layer and a hidden layer with 10 neurons model.add(Dense(10, input_shape=(2,), activation="relu"))
Add a 1-neuron output layer model.add(Dense(1))
Summarise your model model.summary()