当前位置: 首页 > 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不会将其考虑在内。

该函数对于给定的非线性函数,返回推荐的增益值。这些值如下所示:

NonlinearityGain
Linear / Identity 1 1 1
Conv1D / Conv2D / Conv3D 1 1 1
Sigmoid 1 1 1
Tanh 5 3 \frac{5}{3} 35
ReLU 2 \sqrt{2} 2
Leaky Relu 2 1 + negative_slope 2 \sqrt{\frac{2}{1+\text{negative\_slope}^2}} 1+negative_slope22
SELU 4 3 \frac{4}{3} 34

为了实现自归一化神经网络,应该使用nonlinearity='linear'而不是nonlinearity='selu'。这使得初始权重的方差为 1 N \frac{1}{N} N1,这对于在前向通道中引入稳定的固定点是必要的。相比之下,SELU的默认增益牺牲了矩形层中更稳定梯度流的归一化效应。

语法

torch.nn.init.calculate_gain(nonlinearity, param=None)

参数

  • nonlinearity:[nn.functional] 非线性函数名称
  • param:非线性函数的可选参数

实例

# leaky_relu with negative_slope=0.2
gain = nn.init.calculate_gain('leaky_relu', 0.2)  

函数实现

def calculate_gain(nonlinearity, param=None):r"""Return the recommended gain value for the given nonlinearity function.The values are as follows:================= ====================================================nonlinearity      gain================= ====================================================Linear / Identity :math:`1`Conv{1,2,3}D      :math:`1`Sigmoid           :math:`1`Tanh              :math:`\frac{5}{3}`ReLU              :math:`\sqrt{2}`Leaky Relu        :math:`\sqrt{\frac{2}{1 + \text{negative\_slope}^2}}`SELU              :math:`\frac{3}{4}`================= ====================================================.. warning::In order to implement `Self-Normalizing Neural Networks`_ ,you should use ``nonlinearity='linear'`` instead of ``nonlinearity='selu'``.This gives the initial weights a variance of ``1 / N``,which is necessary to induce a stable fixed point in the forward pass.In contrast, the default gain for ``SELU`` sacrifices the normalisationeffect for more stable gradient flow in rectangular layers.Args:nonlinearity: the non-linear function (`nn.functional` name)param: optional parameter for the non-linear functionExamples:>>> gain = nn.init.calculate_gain('leaky_relu', 0.2)  # leaky_relu with negative_slope=0.2.. _Self-Normalizing Neural Networks: https://papers.nips.cc/paper/2017/hash/5d44ee6f2c3f71b73125876103c8f6c4-Abstract.html"""linear_fns = ['linear', 'conv1d', 'conv2d', 'conv3d', 'conv_transpose1d', 'conv_transpose2d', 'conv_transpose3d']if nonlinearity in linear_fns or nonlinearity == 'sigmoid':return 1elif nonlinearity == 'tanh':return 5.0 / 3elif nonlinearity == 'relu':return math.sqrt(2.0)elif nonlinearity == 'leaky_relu':if param is None:negative_slope = 0.01elif not isinstance(param, bool) and isinstance(param, int) or isinstance(param, float):# True/False are instances of int, hence check abovenegative_slope = paramelse:raise ValueError("negative_slope {} not a valid number".format(param))return math.sqrt(2.0 / (1 + negative_slope ** 2))elif nonlinearity == 'selu':return 3.0 / 4  # Value found empirically (https://github.com/pytorch/pytorch/pull/50664)else:raise ValueError("Unsupported nonlinearity {}".format(nonlinearity))
http://www.khdw.cn/news/36297.html

相关文章:

  • 网站后台账户密码软文写作平台发稿
  • 做网站cnfgseo快速排名软件价格
  • 日照网站建设哪家好seo论坛站长交流
  • node mysql做动态网站今天的新闻发布会
  • 九江网站建设公司软件推广的渠道是哪里找的
  • 上海备案证查询网站查询系统想要网站推广页
  • wordpress仿制建设搜索引擎优化包括
  • 重庆旅游网页设计网站seo关键词优化
  • 沈阳网站制作哪家好百度关键词搜索排名多少钱
  • 网站开发第三方支付宁波seo高级方法
  • 有没有做php项目实战的网站自媒体培训
  • wordpress 绑定多个二级域名自动app优化官网
  • 网站建设策划 流程网站设计公司排行
  • 十大接单网站脚本外链平台
  • 网站模版idc台州网站建设方案推广
  • 电子商务网站建设前的分析技能培训
  • 做暧暧视频网站爱站网权重查询
  • 济南网站建设平台seo专员是什么职位
  • 做外贸哪个网站比较好2017今日国内新闻
  • 适合毕设做的简单网站seo价格是多少
  • 武汉教育网站建设优化商务软文写作范文200字
  • 怎么做服务器网站网络营销推广方案3篇
  • dw免费网站模板职业技能培训有哪些
  • 蓝科企业网站系统免费b站在线观看人数在哪里找到
  • 佛山中小企业外贸网站建设推广知名的seo快速排名多少钱
  • 郑州网站建设外包业务全网营销策划公司
  • 企业管理咨询公司注册条件网站seo设置是什么
  • 滨州公司做网站短视频推广引流
  • 漫画驿站网页设计图纸尺寸图关键词怎么选择技巧
  • web和网站的区别吗今日新闻最新10条