tf.random_uniform_initializer

简介:

random_uniform_initializer = RandomUniform()

可简写为tf.RandomUniform()

生成均匀分布的随机数,参数有四个(minval=0, maxval=None, seed=None, dtype=dtypes.float32),分别用于指定最小值,最大值,随机数种子和类型。


Help on class RandomUniform in module tensorflow.python.ops.init_ops:


class RandomUniform(Initializer)

 |  Initializer that generates tensors with a uniform distribution.

 |  

 |  Args:

 |    minval: A python scalar or a scalar tensor. Lower bound of the range

 |      of random values to generate.

 |    maxval: A python scalar or a scalar tensor. Upper bound of the range

 |      of random values to generate.  Defaults to 1 for float types.

 |    seed: A Python integer. Used to create random seeds. See

 |      @{tf.set_random_seed}

 |      for behavior.

 |    dtype: The data type.

 |  

 |  Method resolution order:

 |      RandomUniform

 |      Initializer

 |      builtins.object

 |  

 |  Methods defined here:

 |  

 |  __call__(self, shape, dtype=None, partition_info=None)

 |      Call self as a function.

 |  

 |  __init__(self, minval=0, maxval=None, seed=None, dtype=tf.float32)

 |      Initialize self.  See help(type(self)) for accurate signature.

 |  

 |  get_config(self)

 |      Returns the configuration of the initializer as a JSON-serializable dict.

 |      

 |      Returns:

 |        A JSON-serializable Python dict.

 |  

 |  ----------------------------------------------------------------------

 |  Class methods inherited from Initializer:

 |  

 |  from_config(config) from builtins.type

 |      Instantiates an initializer from a configuration dictionary.

 |      

 |      Example:

 |      

 |      ```python

 |      initializer = RandomUniform(-1, 1)

 |      config = initializer.get_config()

 |      initializer = RandomUniform.from_config(config)

 |      ```

 |      

 |      Args:

 |        config: A Python dictionary.

 |          It will typically be the output of `get_config`.

 |      

 |      Returns:

 |        An Initializer instance.

 |  

 |  ----------------------------------------------------------------------

 |  Data descriptors inherited from Initializer:

 |  

 |  __dict__

 |      dictionary for instance variables (if defined)

 |  

 |  __weakref__

 |      list of weak references to the object (if defined)


目录
相关文章
|
10月前
|
数据格式
详解torch.size
详解torch.size
111 0
详解torch.size
|
数据可视化 PyTorch 算法框架/工具
np.squeeze 的用法
np.squeeze 的用法
(2)tf.Variable中trainable作用
如果为True,则会默认将变量添加到图形集合GraphKeys.TRAINABLE_VARIABLES中。此集合用于优化器Optimizer类优化的的默认变量列表,如果为False则在训练时不会更新该值。
110 0
|
TensorFlow 算法框架/工具
TensorFlow教程(6) tf.Variable() 和tf.get_variable()
TensorFlow教程(6) tf.Variable() 和tf.get_variable()
152 0
|
定位技术 内存技术
TF 卡是什么
TF 卡是什么
398 0
|
Python 算法框架/工具 TensorFlow
|
TensorFlow 算法框架/工具 异构计算