当前位置: 首页 > news >正文

直销网站建设 优帮云网络营销软件网站

直销网站建设 优帮云,网络营销软件网站,潍坊淘宝网站建设,wordpress 贴吧主题分类目录:《深入浅出Pytorch函数》总目录 相关文章: 深入浅出Pytorch函数——torch.nn.init.calculate_gain 深入浅出Pytorch函数——torch.nn.init.uniform_ 深入浅出Pytorch函数——torch.nn.init.normal_ 深入浅出Pytorch函数——torch.nn.init.c…

分类目录:《深入浅出Pytorch函数》总目录
相关文章:
· 深入浅出Pytorch函数——torch.nn.init.calculate_gain
· 深入浅出Pytorch函数——torch.nn.init.uniform_
· 深入浅出Pytorch函数——torch.nn.init.normal_
· 深入浅出Pytorch函数——torch.nn.init.constant_
· 深入浅出Pytorch函数——torch.nn.init.ones_
· 深入浅出Pytorch函数——torch.nn.init.zeros_
· 深入浅出Pytorch函数——torch.nn.init.eye_
· 深入浅出Pytorch函数——torch.nn.init.dirac_
· 深入浅出Pytorch函数——torch.nn.init.xavier_uniform_
· 深入浅出Pytorch函数——torch.nn.init.xavier_normal_
· 深入浅出Pytorch函数——torch.nn.init.kaiming_uniform_
· 深入浅出Pytorch函数——torch.nn.init.kaiming_normal_
· 深入浅出Pytorch函数——torch.nn.init.trunc_normal_
· 深入浅出Pytorch函数——torch.nn.init.orthogonal_
· 深入浅出Pytorch函数——torch.nn.init.sparse_


torch.nn.init模块中的所有函数都用于初始化神经网络参数,因此它们都在torc.no_grad()模式下运行,autograd不会将其考虑在内。

根据Glorot, X.和Bengio, Y.在《Understanding the difficulty of training deep feedforward neural networks》中描述的方法,用一个均匀分布生成值,填充输入的张量或变量。结果张量中的值采样自 U ( − a , a ) U(-a, a) U(a,a),其中:
a = gain × 6 fan_in + fan_put a=\text{gain}\times\sqrt{\frac{6}{\text{fan\_in}+\text{fan\_put}}} a=gain×fan_in+fan_put6

这种方法也被称为Glorot initialization。

语法

torch.nn.init.xavier_uniform_(tensor, gain=1)

参数

  • tensor:[Tensor] 一个 N N N维张量torch.Tensor
  • gain :[float] 可选的缩放因子

返回值

一个torch.Tensor且参数tensor也会更新

实例

w = torch.empty(3, 5)
nn.init.xavier_uniform_(w, gain=nn.init.calculate_gain('relu'))

函数实现

def xavier_uniform_(tensor: Tensor, gain: float = 1.) -> Tensor:r"""Fills the input `Tensor` with values according to the methoddescribed in `Understanding the difficulty of training deep feedforwardneural networks` - Glorot, X. & Bengio, Y. (2010), using a uniformdistribution. The resulting tensor will have values sampled from:math:`\mathcal{U}(-a, a)` where.. math::a = \text{gain} \times \sqrt{\frac{6}{\text{fan\_in} + \text{fan\_out}}}Also known as Glorot initialization.Args:tensor: an n-dimensional `torch.Tensor`gain: an optional scaling factorExamples:>>> w = torch.empty(3, 5)>>> nn.init.xavier_uniform_(w, gain=nn.init.calculate_gain('relu'))"""fan_in, fan_out = _calculate_fan_in_and_fan_out(tensor)std = gain * math.sqrt(2.0 / float(fan_in + fan_out))a = math.sqrt(3.0) * std  # Calculate uniform bounds from standard deviationreturn _no_grad_uniform_(tensor, -a, a)
http://www.shuangfujiaoyu.com/news/18614.html

相关文章:

  • 购物网站开发 项目描述百度精准推广
  • wordpress用阿里云图床青岛seo招聘
  • 网站csv导入杭州seo推广服务
  • 请将已备案网站接入访问百度关键词代做排名
  • 潍坊公司注册网站网红推广
  • 微信分销平台排行免费关键词优化工具
  • 定制网站建设多少钱百度今日数据统计
  • 龙岗这边哪里有教做网站的合肥优化推广公司
  • seo做网站赚钱什么是网络销售
  • 做文献ppt模板下载网站什么是营销型网站?
  • 不动产登记网站建设排名优化软件点击
  • 视频教学网站开发黑帽seo培训多少钱
  • 做公司门户网站的重点深圳推广公司排行榜
  • 电子商务网站建设心得体会精准拓客软件哪个好
  • 延吉网站制作国外推广渠道平台
  • 网站建设与维护试卷论文网站推广服务商
  • 免费的企业品牌策划公司赣州seo
  • 一般网站建设企业搜索引擎是指什么
  • thinkphp网站开发实战教程网络营销的方式包括
  • 广州知名网站建设网页设计服务如何推广一个项目
  • 70 网站制作十大管理培训课程
  • 网站的功能测试怎么做的论坛软文案例
  • 成都网站建设那家好百度指数免费添加
  • 建立旅游网站的目的百度推广业务电话
  • 西乡移动网站建设潍坊网站开发公司
  • 济南市莱芜区都市网seo顾问服务咨询
  • 龙华建设发展有限公司网站泰州seo平台
  • 培训web设计西安企业网站seo
  • 网站优化建设吴江seo网站优化软件
  • 新闻网站建设汇报材料图片优化网站