- Intelligent Projects Using Python
- Santanu Pattanayak
- 73字
- 2021-07-02 14:10:51
The ResNet50 transfer learning network
The ResNet50 model for transfer learning can be defined similarly to the VGG16 and InceptionV3 networks, as follows:
def resnet_pseudo(dim=224,freeze_layers=10,full_freeze='N'):
# model_save_dest = {}
model = ResNet50(weights='imagenet',include_top=False)
x = model.output
x = GlobalAveragePooling2D()(x)
x = Dense(512, activation='relu')(x)
x = Dropout(0.5)(x)
x = Dense(512, activation='relu')(x)
x = Dropout(0.5)(x)
out = Dense(5,activation='softmax')(x)
model_final = Model(input = model.input,outputs=out)
if full_freeze != 'N':
for layer in model.layers[0:freeze_layers]:
layer.trainable = False
return model_final
推薦閱讀
- Aftershot Pro:Non-destructive photo editing and management
- Arduino入門基礎教程
- Augmented Reality with Kinect
- Creating Dynamic UI with Android Fragments
- 嵌入式系統設計教程
- Learning Stencyl 3.x Game Development Beginner's Guide
- Learning Game Physics with Bullet Physics and OpenGL
- R Deep Learning Essentials
- BeagleBone Robotic Projects
- Blender Game Engine:Beginner's Guide
- 圖解計算機組裝與維護
- WebGL Hotshot
- Angular 6 by Example
- 可編程邏輯器件項目開發設計
- Blender for Video Production Quick Start Guide