当前位置:网站首页>Paddlepaddle 34 adjust the layer structure and forward process of the model (realize the addition, deletion, modification and forward modification of the layer)
Paddlepaddle 34 adjust the layer structure and forward process of the model (realize the addition, deletion, modification and forward modification of the layer)
2022-07-25 07:09:00 【Ten thousand miles and a bright future arrived in an instant】
Generally speaking, adjusting the model layer Structure and forward The process needs to modify the definition code of the model , This will pollute the original model definition code . And , After modifying the model structure at the source level , It will make the model unable to load and adapt to the previous pre training parameters . For this reason, bloggers have realized that without polluting the model definition code , Only on model Object for property modification , The model layer Structure and forward Process adjustment . Originally, the blogger was pytorch The following is that the work has been realized ( Implement links ), But when applied to paddle There is acclimatization , So for paddle The framework does the work here .
This blog is mainly set layer New 、 Modify and delete ,forward Process modification . among ,layer The revision of is already in Section of this column 29 Chapter Realized . Here is a brief introduction .
1、layer Modification and deletion of
layer The modification and deletion of are in paddle model In fact, it is the same thing , Modification means that layer Replace with new layer, Delete means to delete layer Replace empty layer(nn.Sequential() object ). Its core is to realize layer Replacement , The replacement code is as follows :
import paddle
def _set_module(model,</边栏推荐
- What are the hazards of insufficient sleep?
- New tea, start "fighting in groups"
- [yolov5 practice 3] traffic sign recognition system based on yolov5 - model training
- Default value of dart variable
- Health clock in daily reminder tired? Then let automation help you -- hiflow, application connection automation assistant
- 使用 Web API 上传和下载多个文件
- 10 minutes to understand how JMeter plays with redis database
- The relationship between Informatics, mathematics and Mathematical Olympiad (July 19, 2022) C
- Talk about practice, do solid work, and become practical: tour the digitalized land of China
- 如何在KVM环境中使用网络安装部署多台虚拟服务器
猜你喜欢

使用 Web API 上传和下载多个文件

QT actual combat case (53) -- using qdrag to realize the drag puzzle function

Box horse "waist cut", blame Hou Yi for talking too much?

File operation-

Create a new STM32 project and configure it - based on registers

Talk about practice, do solid work, and become practical: tour the digitalized land of China

常吃发酵馒头是否会伤害身体

Kyligence Li Dong: from the data lake to the index middle stage, improve the ROI of data analysis

EFCore高级Saas系统下单DbContext如何支持不同数据库的迁移

睡眠不足有哪些危害?
随机推荐
Expandablelistview nested GridView display incomplete problem
The income of bank financial management is getting lower and lower. Now which financial products have high income?
__ str__ Output class
30 times performance improvement -- implementation of MyTT index library based on dolphin DB
使用 Web API 上传和下载多个文件
Upload and download multiple files using web APIs
How to learn C language?
[add, delete, modify, and check the array base]
The ultimate difference between MVC and three-tier architecture
scrapy定时爬虫的思路
Dart final and const variables
常吃发酵馒头是否会伤害身体
Hierarchical reinforcement learning: a comprehensive survey
Flinkcdc2.0 uses flinksql to collect MySQL
Ideal L9, can't cross a pit on the road?
Cointelegraph撰文:依托最大的DAO USDD成为最可靠的稳定币
Leetcode46 Full Permutation (Introduction to backtracking)
Vscode saves setting configuration parameters to the difference between users and workspaces
Enable the free pan domain SSL certificate for kubesphere cluster and realize the automatic update and distribution of certificates
如何在KVM环境中使用网络安装部署多台虚拟服务器