tf.keras.backend.random_normal_variable | TensorFlow v2.0.0 (original) (raw)
tf.keras.backend.random_normal_variable
Stay organized with collections Save and categorize content based on your preferences.
Instantiates a variable with values drawn from a normal distribution.
View aliases
Compat aliases for migration
SeeMigration guide for more details.
tf.compat.v1.keras.backend.random_normal_variable
tf.keras.backend.random_normal_variable(
shape, mean, scale, dtype=None, name=None, seed=None
)
Arguments | |
---|---|
shape | Tuple of integers, shape of returned Keras variable. |
mean | Float, mean of the normal distribution. |
scale | Float, standard deviation of the normal distribution. |
dtype | String, dtype of returned Keras variable. |
name | String, name of returned Keras variable. |
seed | Integer, random seed. |
Returns |
---|
A Keras variable, filled with drawn samples. |
Example:
# TensorFlow example
>>> kvar = K.random_normal_variable((2,3), 0, 1)
>>> kvar
<tensorflow.python.ops.variables.Variable object at 0x10ab12dd0>
>>> K.eval(kvar)
array([[ 1.19591331, 0.68685907, -0.63814116],
[ 0.92629528, 0.28055015, 1.70484698]], dtype=float32)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.