前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >keras.initializers.Initializer

keras.initializers.Initializer

作者头像
狼啸风云
修改2022-09-03 20:05:25
5740
修改2022-09-03 20:05:25
举报

Class Initializer

Initializer base class: all initializers inherit from this class.

Aliases:

  • Class tf.compat.v2.initializers.Initializer
  • Class tf.compat.v2.keras.initializers.Initializer
  • Class tf.initializers.Initializer

Methods

__call__

View source

代码语言:javascript
复制
__call__(
    shape,
    dtype=None
)

Returns a tensor object initialized as specified by the initializer.

Args:

  • shape: Shape of the tensor.
  • dtype: Optional dtype of the tensor. If not provided will return tensor of tf.float32.

from_config

View source

代码语言:javascript
复制
@classmethod
from_config(
    cls,
    config
)

Instantiates an initializer from a configuration dictionary.

Example:

代码语言:javascript
复制
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.

get_config

View source

代码语言:javascript
复制
get_config()

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

Returns:

  • A JSON-serializable Python dict.
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2020-01-10 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Class Initializer
  • __call__
  • from_config
  • get_config
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档