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

深圳开发公司网站建设比较好的东莞建设网

深圳开发公司网站建设比较好的,东莞建设网,做身份证网站,兄弟网络(西安网站建设制作公司)分类目录:《深入浅出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》中描述的方法,用一个正态分布生成值,填充输入的张量或变量。结果张量中的值采样自 N ( 0 , std 2 ) N(0, \text{std}^2) N(0,std2)的正态分布,其中标准差:
std = gain × 2 fan_in + fan_put \text{std}=\text{gain}\times\sqrt{\frac{2}{\text{fan\_in}+\text{fan\_put}}} std=gain×fan_in+fan_put2

这种方法也被称为Glorot initialisation。

语法

torch.nn.init.xavier_normal_(tensor, gain=1.0)

参数

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

返回值

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

实例

w = torch.empty(3, 5)
nn.init.xavier_normal_(w)

函数实现

def xavier_normal_(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 normaldistribution. The resulting tensor will have values sampled from:math:`\mathcal{N}(0, \text{std}^2)` where.. math::\text{std} = \text{gain} \times \sqrt{\frac{2}{\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_normal_(w)"""fan_in, fan_out = _calculate_fan_in_and_fan_out(tensor)std = gain * math.sqrt(2.0 / float(fan_in + fan_out))return _no_grad_normal_(tensor, 0., std)
http://www.yidumall.com/news/55574.html

相关文章:

  • 做机加工的网站媒体发布平台
  • 个人网站建设及实现自媒体平台注册入口
  • 莞城区网站仿做北京seo关键词排名优化
  • 什么叫域名如何优化搜索引擎的准确性
  • 选择电商网站建设镇江seo公司
  • 干事儿网网站开发seo公司排名
  • 烟台网站建设合肥公司百度一下你就知道啦
  • 易用的做网站软件海南百度推广开户
  • 潍坊网站谷歌关键词搜索排名
  • wordpress文章文件东莞seo报价
  • 做公司网站要多少钱seo知名公司
  • 哪个网站可以做ppt模板推广网站排名
  • 高校后勤网站建设要求宝鸡网站开发公司
  • 在婚恋网站做翻译好吗重庆快速排名优化
  • 医疗网站备案网络营销的背景和意义
  • 网站导航规划超级外链工具 增加外链中
  • 一站式网站手机端怎么做网络营销服务商有哪些
  • 网站开发服务费记账seo实战培训费用
  • asp网站制作实例教程网络营销技巧
  • 北京做网站的公司哪家好百度站长工具网站提交
  • 网站建设开发报价单seo的基本步骤顺序正确的是
  • 足彩网站怎样做推广营销型制作网站公司
  • 获取网站物理路径网络推广平台有哪些
  • 福田网站制作比较好的网络营销工具体系
  • 网站制作真人游戏娱乐平台怎么做优化大师客服
  • 获取网站全站代码外链代发免费
  • 可以做婚礼视频的网站有哪些国内最好用免费建站系统
  • 做的响应式网站用什么测试天津优化网络公司的建议
  • 无锡华诚建设监理有限公司网站怎么让某个关键词排名上去
  • 便宜虚拟主机做网站备份重庆seo排名扣费