Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # KERAS
- conv_base = ResNet50(include_top=False,
- weights='imagenet')
- for layer in conv_base.layers:
- layer.trainable = False
- x = conv_base.output
- x = layers.GlobalAveragePooling2D()(x)
- x = layers.Dense(128, activation='relu')(x)
- predictions = layers.Dense(2, activation='softmax')(x)
- model = Model(conv_base.input, predictions)
- optimizer = keras.optimizers.Adam()
- model.compile(loss='sparse_categorical_crossentropy',
- optimizer=optimizer,
- metrics=['accuracy'])
Add Comment
Please, Sign In to add comment