Advertisement
Guest User

Untitled

a guest
Dec 15th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. def single_layer_model(input_shape):
  2.     model = Sequential()
  3.  
  4.     # 2D convolution layer (e.g. spatial convolution over images).
  5.    # model.add(Conv2D(32, (3, 3), input_shape=input_shape))
  6.     model.add(Dense(30, input_shape=input_shape, activation="relu", kernel_initializer="normal"))
  7.     # Flattens the input. Does not affect the batch size.
  8.     model.add(Flatten())
  9.  
  10.     # Regular densely-connected NN layer.
  11.     model.add(Dense(10,  activation='softmax', kernel_initializer="normal"))
  12.  
  13.     model.compile(loss='categorical_crossentropy',
  14.                   optimizer='adam',
  15.                   metrics=['accuracy'])
  16.     return model
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement