码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • slim.variance_scaling_initializer()


    参考  slim.l2_regularizer() - 云+社区 - 腾讯云

    参考 slim.variance_scaling_initializer() - 云+社区 - 腾讯云

    1. def xavier_initializer(uniform=True, seed=None, dtype=dtypes.float32):
    2. """Returns an initializer performing "Xavier" initialization for weights.
    3. This function implements the weight initialization from:
    4. Xavier Glorot and Yoshua Bengio (2010):
    5. [Understanding the difficulty of training deep feedforward neural
    6. networks. International conference on artificial intelligence and
    7. statistics.](
    8. http://www.jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf)
    9. This initializer is designed to keep the scale of the gradients roughly the
    10. same in all layers. In uniform distribution this ends up being the range:
    11. `x = sqrt(6. / (in + out)); [-x, x]` and for normal distribution a standard
    12. deviation of `sqrt(2. / (in + out))` is used.
    13. Args:
    14. uniform: Whether to use uniform or normal distributed random initialization.
    15. seed: A Python integer. Used to create random seeds. See
    16. `tf.set_random_seed` for behavior.
    17. dtype: The data type. Only floating point types are supported.
    18. Returns:
    19. An initializer for a weight matrix.
    20. Raises:
    21. ValueError: if `dtype` is not a floating point type.
    22. TypeError: if `mode` is not in ['FAN_IN', 'FAN_OUT', 'FAN_AVG'].
    23. """
    24. if not dtype.is_floating:
    25. raise TypeError('Cannot create initializer for non-floating point type.')
    26. if mode not in ['FAN_IN', 'FAN_OUT', 'FAN_AVG']:
    27. raise TypeError('Unknown mode %s [FAN_IN, FAN_OUT, FAN_AVG]', mode)

    返回对权重执行“Xavier”初始化的初始化器。此函数实现权重初始化,从:

    Xavier Glorot和yobengio(2010):[了解深度前馈神经网络训练的难点]。(http://www.jmlr.org/programedings/papers/v9/glorot10a/glorot10a.pdf)

    这个初始化器的设计目的是在所有层中保持梯度的比例大致相同。在均匀分布中,这个范围是' x = sqrt(6。/ (in + out);正态分布的标准差为√2。/ (in + out))’。

    参数:

    • factor:浮动。一个乘法因素
    • mode:字符串。“FAN_IN”、“FAN_OUT’,‘FAN_AVG’
    • uniform:是否使用均匀或正态分布随机初始化
    • seed:一个Python整数。用于创建随机种子。看到“特遣部队。set_random_seed”行为
    • dtype:数据类型。只支持浮点类型

    返回值:

    • 生成单位方差张量的初始化器

    可能产生的异常:

    1. ValueError: if `dtype` is not a floating point type.
    2. TypeError: if `mode` is not in ['FAN_IN', 'FAN_OUT', 'FAN_AVG'].

  • 相关阅读:
    万卷书 - 欧洲的门户 [The Gates of Europe]
    零售业迎来全新发展,这个技术少不了
    Vue中axios拦截器怎么使用
    Java-抽象类、抽象方法
    模式分解的概念(下)-无损连接分解的与保持函数依赖分解的定义和判断、损失分解
    【C++】从零开始的CS:GO逆向分析3——写出一个透视
    表格的综合案例
    博客 - - Hexo + fluid + Github 搭建教程(github.io)
    Java项目—停车场管理系统(附源码+资料课件)
    PyCharm 调试过程中控制台 (Console) 窗口内运行命令 - 实时获取中间状态
  • 原文地址:https://blog.csdn.net/weixin_36670529/article/details/99726741
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号