当前位置:网站首页>After the model is created, initialize the variables in con2d, convtranspose2d, and normalized batchnorm2d functions
After the model is created, initialize the variables in con2d, convtranspose2d, and normalized batchnorm2d functions
2022-06-23 16:15:00 【Growth of code Xiaobai】
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)
# Defining models
m = model()
m.cuda()
# Model initialization
weights_init(m)
边栏推荐
- 如何让销售管理更高效?
- How does the web container initialize third-party plug-ins
- R语言plotly可视化:plotly可视化在对比条形图中添加误差条(Bar Chart with Error Bars with plotly in R)
- 安全舒适,全新一代奇骏用心诠释老父亲的爱
- MySQL中json_extract函数说明
- Servlet 3.0的AsyncListener接口
- Glibc NPTL library pthread_ mutex_ Lock and pthread_ mutex_ Analysis of unlock
- R语言使用yardstick包的rmse函数评估回归模型的性能、评估回归模型在每个交叉验证(或者重采样)的每一折fold上的RMSE、以及整体的均值RMSE(其他指标mae、mape等计算方式类似)
- TCP protocol notes
- Block, non block, multiplexing, synchronous, asynchronous, bio, NiO, AIO
猜你喜欢

stylegan1: a style-based henerator architecture for gemerative adversarial networks

【TcaplusDB知识库】Tmonitor后台一键安装介绍(二)

线程池

Quartz

Block, non block, multiplexing, synchronous, asynchronous, bio, NiO, AIO

【历史上的今天】6 月 23 日:图灵诞生日;互联网奠基人出生;Reddit 上线

线上交流丨可信机器学习之机器学习与知识推理相结合(青源Talk第20期 李博)

Summarize the experience of purchasing Alibaba cloud servers

【TcaplusDB知识库】Tmonitor单机安装指引介绍(一)

多年亿级流量下的高并发经验总结,都毫无保留地写在了这本书中
随机推荐
Object
《Apache Commons 工具类》
Summarize the experience of purchasing Alibaba cloud servers
If no code is moved, the project access speed drops significantly the next day. Case analysis
XML
139. word splitting
A tour of grpc:01 - Basic Theory
R语言使用tidyquant包的tq_transmute函数计算持有某只股票的天、月、周收益率、ggplot2使用条形图(bar plot)可视化股票月收益率数据、使用百分比显示Y轴坐标数据
golang数据类型图
readImg: 读取图片到Variable变量
npm 如何发包 删包
数组自带的方法
R语言使用magick包的image_scale函数对图像进行缩放(resize)、可以自定义从宽度或者高度角度进行缩放
MySQL transactions and locks
Asynclistener interface of servlet 3.0
MATLAB中iscellstr函数的使用
Web篇_01 了解web开发
苹果 iPhone、三星手机等电子产品开始经平行进口渠道进入俄罗斯
[tcapulusdb knowledge base] Introduction to tmonitor background one click installation (I)
SSRS页面配置Postgresql data source的方法