Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def single_layer_model(input_shape):
- model = Sequential()
- # 2D convolution layer (e.g. spatial convolution over images).
- # model.add(Conv2D(32, (3, 3), input_shape=input_shape))
- model.add(Dense(30, input_shape=input_shape, activation="relu", kernel_initializer="normal"))
- # Flattens the input. Does not affect the batch size.
- model.add(Flatten())
- # Regular densely-connected NN layer.
- model.add(Dense(10, activation='softmax', kernel_initializer="normal"))
- model.compile(loss='categorical_crossentropy',
- optimizer='adam',
- metrics=['accuracy'])
- return model
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement