当前位置:网站首页>创建好后的模型,对Con2d, ConvTranspose2d ,以及归一化BatchNorm2d函数中的变量进行初始化
创建好后的模型,对Con2d, ConvTranspose2d ,以及归一化BatchNorm2d函数中的变量进行初始化
2022-06-23 15:09:00 【代码小白的成长】
def weights_init(m):
classname = m.__class__.__name__
if (classname.find('Conv2d') != -1) | (classname.find('ConvTranspose2d') != -1):
m.weight.data.normal_(0.0, 0.02)
elif classname.find('BatchNorm2d') != -1:
m.weight.data.normal_(1.0, 0.02)
m.bias.data.fill_(0)
# 定义模型
m = model()
m.cuda()
# 模型初始化
weights_init(m)
边栏推荐
- Converging ecology, enabling safe operation, Huawei cloud security, cloud brain intelligent service security
- FPGA 常用缩写及单词在工程领域内的意义
- Simple understanding of quick sort
- FPN特征金字塔网络
- 他山之石 | 微信搜一搜中的智能问答技术
- Detailed steps for MySQL dual master configuration
- 《墨者学院——SQL手工注入漏洞测试(MySQL数据库)》
- [MAE]Masked Autoencoders掩膜自编码器
- The meaning of FPGA abbreviations and words in engineering field
- [cloud based co creation] intelligent supply chain plan: improve the decision-making level of the supply chain and help enterprises reduce costs and increase efficiency
猜你喜欢
Redis缓存三大异常的处理方案梳理总结

JS create an array (literal)

SQL injection vulnerability (principle)

Important knowledge of golang: atomic atomic operation

WebService interface publishing and calling
Solution to the problem that MySQL cannot be started in xampp

【无标题】激光焊接在医疗中的应用

JS里的数组

Big factory Architect: how to draw a grand business map?

Convert JSON file of labelme to coco dataset format
随机推荐
【无标题】激光焊接在医疗中的应用
Diffraction of light
Important knowledge of golang: sync Once explanation
Volatile~ variables are not visible under multithreading
Une compréhension simple du tri rapide
Unshift() and shift() of JS
PHP 2D array insert
32. Compose 优美的触摸动画
JS中的pop()元素
Idea view View the class file idea Class folder
glibc nptl库pthread_mutex_lock和pthread_mutex_unlock浅析
嵌入式软件架构设计-程序分层
任何代码未动的情况下第二天项目访问速度明显下降,案例分析
重卡界销售和服务的“扛把子”,临沂广顺深耕产品全生命周期服务
Sectigo(Comodo)证书的由来
MySQL series: storage engine
Mysql database - log management, backup and recovery
Pop() element in JS
【opencv450】椒盐噪声demo
Thymeleaf——学习笔记