- 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
推薦閱讀
- Raspberry Pi 3 Cookbook for Python Programmers
- BeagleBone By Example
- 硬件產品經理手冊:手把手構建智能硬件產品
- 深入淺出SSD:固態存儲核心技術、原理與實戰(第2版)
- 電腦軟硬件維修從入門到精通
- Wireframing Essentials
- 圖解計算機組裝與維護
- 筆記本電腦芯片級維修從入門到精通(圖解版)
- 基于網絡化教學的項目化單片機應用技術
- FPGA實驗實訓教程
- Zabbix 4 Network Monitoring
- 現代多媒體技術及應用
- Practical Artificial Intelligence and Blockchain
- 超炫的35個Arduino制作項目
- SOA架構:服務和微服務分析及設計(原書第2版)