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)