Skip to content

Instantly share code, notes, and snippets.

View nonlinearjunkie's full-sized avatar
👹
Stay Metal..Stay Brutal!

Suraj Joshi nonlinearjunkie

👹
Stay Metal..Stay Brutal!
View GitHub Profile
position_block_15 = base_model.get_layer('block_15_add')
for layer in base_model.layers:
layer.trainable = True
all_layers = base_model.layers
for i in range(base_model.layers.index(position_block_15)):
all_layers[i].trainable = False
base_model = tf.keras.applications.MobileNetV2(input_shape=(224,224,3),
alpha=1.0,
include_top=False,
weights="imagenet")
for layer in base_model.layers:
layer.trainable = False
model_transfered_1=Sequential()
model_transfered_1.add(base_model)
base_model = tf.keras.applications.MobileNetV2(input_shape=(224,224,3),
alpha=1.0,
include_top=False,
weights="imagenet")
for layer in base_model.layers:
layer.trainable = False
model_transfered_1=Sequential()
model_transfered_1.add(base_model)
model=Sequential()
# Conv-layer-1
model.add(Conv2D(32,(3,3),input_shape=(128,128,1)))
model.add(BatchNormalization())
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2,2)))
model.add(Dropout(0.3))
# Conv-layer-2
model=Sequential()
# Conv-layer-1
model.add(Conv2D(32,(3,3),input_shape=(128,128,1)))
model.add(BatchNormalization())
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2,2)))
# Conv-layer-2
model.add(Conv2D(128,(5,5)))