
目录
1、__call__
2、from_config
3、get_config
生成初始化为1的张量的初始化器。
__call____call__(
shape,
dtype=tf.dtypes.float32
)返回初始化器指定的初始化张量对象。
参数:
shape:张量的形状。dtype:张量的可选的。只支持数值型或布尔型。可能产生的异常:
ValuesError: If the dtype is not numeric or boolean.from_configfrom_config(
cls,
config
)从配置字典实例化初始化器。
例:
initializer = RandomUniform(-1, 1)
config = initializer.get_config()
initializer = RandomUniform.from_config(config)参数:
config:Python字典。它通常是get_config的输出。返回值:
get_configget_config()以JSON-serializable dict的形式返回初始化器的配置。
返回: