tf.zeros_initializer

https://github.com/tensorflow/docs/tree/r1.4/site/en/api_docs/api_docs/python/tf
site/en/api_docs/api_docs/python/tf/zeros_initializer.md

1. Class zeros_initializer

Inherits From: Initializer

inherit [ɪn'herɪt]:vt. 继承,遗传而得 vi. 成为继承人

1.1 Aliases

  • Class tf.initializers.zeros
  • Class tf.keras.initializers.Zeros
  • Class tf.zeros_initializer

Defined in tensorflow/python/ops/init_ops.py.
See the guide: Variables > Sharing Variables

Initializer that generates tensors initialized to 0.
生成张量初始化为 0 的初始化器。

aliase:n. 别名

2. Methods

__init__

__init__(dtype=tf.float32)

__call__

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

from_config

from_config(cls,config
)

Instantiates an initializer from a configuration dictionary.
从配置字典中实例化初始化程序。

Example:

initializer = RandomUniform(-1, 1)
config = initializer.get_config()
initializer = RandomUniform.from_config(config)

2.1 Args

  • config: A Python dictionary. It will typically be the output of get_config. (一个 Python 字典。它通常是 get_config 的输出。)

2. Returns

An Initializer instance.
初始化器实例。

get_config

get_config()

3. example

#!/usr/bin/env python
# -*- coding: utf-8 -*-from __future__ import absolute_import
from __future__ import division
from __future__ import print_functionimport numpy as np
import tensorflow as tf# Create some variables.
v1 = tf.get_variable("v1", shape=[3], initializer=tf.zeros_initializer)
v2 = tf.get_variable("v2", shape=[5], initializer=tf.zeros_initializer)v1 = tf.Print(v1, [v1, "yong", v1.shape, "qiang"], message='debug message:', summarize=9)
v2 = tf.Print(v2, [v2, "yong", v2.shape, "qiang"], message='debug message:', summarize=9)# Add an op to initialize the variables.
init_op = tf.global_variables_initializer()# Later, launch the model, initialize the variables.
with tf.Session() as sess:sess.run(init_op)sess.run(v1)sess.run(v2)
/usr/bin/python2.7 /home/strong/tensorflow_work/R2CNN_Faster-RCNN_Tensorflow/yongqiang.py
2019-08-06 15:38:02.660953: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
2019-08-06 15:38:02.745228: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:892] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2019-08-06 15:38:02.745470: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1030] Found device 0 with properties:
name: GeForce GTX 1080 major: 6 minor: 1 memoryClockRate(GHz): 1.7335
pciBusID: 0000:01:00.0
totalMemory: 7.92GiB freeMemory: 7.38GiB
2019-08-06 15:38:02.745480: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1120] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: GeForce GTX 1080, pci bus id: 0000:01:00.0, compute capability: 6.1)
2019-08-06 15:38:02.958696: I tensorflow/core/kernels/logging_ops.cc:79] debug message:[0 0 0][yong][3][qiang]
2019-08-06 15:38:02.959855: I tensorflow/core/kernels/logging_ops.cc:79] debug message:[0 0 0 0 0][yong][5][qiang]Process finished with exit code 0

tf.zeros_initializer相关推荐

  1. tf.variance_scaling_initializer() tensorflow学习:参数初始化

    CNN中最重要的就是参数了,包括W,b. 我们训练CNN的最终目的就是得到最好的参数,使得目标函数取得最小值.参数的初始化也同样重要,因此微调受到很多人的重视,那么tf提供了哪些初始化参数的方法呢,我 ...

  2. tf.contrib.layers.fully_connected详解

    博主 https://www.jianshu.com/p/673fd07954e9 tf.contrib.layers.fully_connected(F, num_outputs,activatio ...

  3. tf之get_Variable()

    转自:https://blog.csdn.net/UESTC_C2_403/article/details/72327321 1. tf.get_variable(name,  shape, init ...

  4. 深度学习 tensorflow tf.layers.conv2d_transpose 反卷积 上采样

    参数 conv2d_transpose( inputs, filters, kernel_size, strides=(1, 1), padding='valid', data_format='cha ...

  5. 【tensorflow】tf.layers.conv1d函数解析(一维卷积)

    TensorFlow函数:tf.layers.Conv1D_w3cschool https://www.w3cschool.cn/tensorflow_python/tensorflow_python ...

  6. 【tensorflow】全连接层函数tf.layers.dense()原理

    TensorFlow全连接层函数tf.layers.dense()原理 - jian shu https://www.jianshu.com/p/3855908b4c29 最近在用TensorFlow ...

  7. tf.layers.dense

    tf.layers.dense( inputs, units, activation=None, use_bias=True, kernel_initializer=None, bias_initia ...

  8. tf.nn 和tf.layers以及tf.contrib.layers的简单区别(转)

    tensorflow不同层的使用(tf.nn 和tf.layers以及tf.contrib.layers)的简单区别(转) 2018年09月02日 18:50:33 holmes_MX 版权声明:原创 ...

  9. TF使用例子-情感分类

    北京站 | NVIDIA DLI深度学习培训 2018年1月26日 NVIDIA 深度学习学院 带你快速进入火热的DL领域 阅读全文 正文共10052个字,4张图,预计阅读时间26分钟. 这次改写一下 ...

最新文章

  1. OpenCv 009---色彩空间与色彩空间转换
  2. Java中的String数据类型归纳
  3. 论文阅读 R-FCN: Object Detection via Region-based Fully Convolutional Networks
  4. USACO-Section1.4 Prime Cryptarithm (搜索)
  5. 用java打出矩形阵型的数字_java输出数字发散矩形
  6. Postgresql 8.2.15 安装文档
  7. 蓝军HVV实用工具和网站总结
  8. android view moveto,android – cursor.moveToPosition(i)的速度有多快?
  9. 【图论】Spfa算法求最短路(长得像Dijkstra的,Bellman_Ford的优化算法)
  10. skycut刻字机软件控制选择
  11. mysql集群解决方案mysql复制原理
  12. CCF-CSP《202206-2—寻宝!大冒险!》
  13. 关于使用硬改的路由器的各种经历
  14. php iis7.5_浅析iis7.5安装配置php环境
  15. 微信公众帐号开发教程第8篇-QQ表情的发送与接收
  16. 列主元高斯消元法_C语言
  17. idea连接远程主机
  18. zabbix 5.0监控客户端
  19. 管理学十大经典图书推荐
  20. Qt源码分析之信号和槽机制

热门文章

  1. Active Network 活跃网络 面试
  2. 为什么巨头要血拼「社区团购」?
  3. js获取当前年月日时间秒毫秒与使用
  4. pythondebug教程_使用spyder3调试python程序的简明教程
  5. 分布式消息队列的避坑指南
  6. isset() 函数
  7. 进入docker容器命令行
  8. linux openssh升级
  9. 解决Mac下ntfs移动磁盘无法读写的比较好的方案
  10. MySQL事务原理浅析