codecamp

TensorFlow函数:tf.random_uniform_initializer

tf.random_uniform_initializer 函数

random_uniform_initializer 类

继承自: Initializer

别名:

  • 类 tf.initializers.random_uniform
  • 类 tf.keras.initializers.RandomUniform
  • 类 tf.random_uniform_initializer

该函数定义在 tensorflow/python/ops/init_ops.py 中.

请您参阅指南:变量>共享变量

生成具有均匀分布的张量的初始化器. 

参数:

  • minval:一个 python 标量或一个标量张量.要生成的随机值范围的下限.
  • maxval:一个 python 标量或一个标量张量.要生成的随机值范围的上限.对于浮点类型默认为1.
  • seed:一个 Python 整数.用于创建随机种子.查看 tf.set_random_seed 的行为.
  • dtype:数据类型.

方法

  • __init__

    __init__(
        minval=0,
        maxval=None,
        seed=None,
        dtype=tf.float32
    )
  • __call__

    __call__(
        shape,
        dtype=None,
        partition_info=None
    )
  • from_config

    from_config(
        cls,
        config
    )

    从配置字典中实例化一个初始化器.

    如下示例:

    initializer = RandomUniform(-1, 1)
    config = initializer.get_config()
    initializer = RandomUniform.from_config(config)

    参数:

    • config:一个 Python 字典.它通常是 get_config 的输出.

    返回值:

    一个初始化实例.

  • get_config

    get_config()
TensorFlow随机值函数:tf.random_uniform
tf.range函数:创建数字序列
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

TensorFlow 函数介绍

TensorFlow 函数模块:tf

TensorFlow的image模块

TensorFlow使用之tf.io

TensorFlow使用之tf.keras

TensorFlow函数教程:tf.keras.applications

TensorFlow函数教程:tf.keras.backend

TensorFlow使用之tf.metrics

TensorFlow使用之tf.nn

TensorFlow使用之tf.python_io

TensorFlow 功能函数

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }