a guest Mar 19th, 2019 99 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- def HappyModel(input_shape):
- # Define the input placeholder as a tensor with shape input_shape.
- X_input = Input(input_shape, name='input')
- # Zero-Padding: pads the border of X_input with zeroes
- X = ZeroPadding2D((3, 3), name='padding')(X_input)
- # CONV -> BN -> RELU Block applied to X
- X = Conv2D(32, (7, 7), strides=(1, 1), name='conv1')(X)
- X = BatchNormalization(axis=3, name='bn1')(X)
- X = Activation('relu', name='relu1')(X)
- # MAXPOOL
- X = MaxPooling2D((2, 2), name='max_pool1')(X)
- # FLATTEN X (means convert it to a vector) + FULLYCONNECTED
- X = Flatten(name='flatten1')(X)
- X = Dense(1, activation='sigmoid', name='fc1-output')(X)
- # Create model. This creates our Keras model instance, you’ll use this instance
- # to train/test the model.
- model = Model(inputs=X_input, outputs=X, name='HappyModel')
- return model
- happyModel = HappyModel(X_train.shape[1:])
RAW Paste Data