[574]tf.nn.xw_plus_b
tf.nn.xw_plus_b函数
tf.nn.xw_plus_b(x,weights,biases,name=None
)
定义在:tensorflow/python/ops/nn_ops.py。
计算matmul(x, weights) + biases。
参数:
- x:2D Tensor。维度通常为:batch,in_units
- weights:2D Tensor。维度通常为:in_units,out_units
- biases:1D Tensor。维度为:out_units
- name:操作的名称(可选)。如果未指定,则使用“xw_plus_b”。
返回:
- 2-D Tensor用来计算matmul(x, weights) + biases。维度通常为:batch,out_units。
tf.nn.xw_plus_b((x, weights) + biases)
相当于tf.matmul(x, weights) + biases
#-*-coding:utf8-*-
import tensorflow as tf
x=[[1, 2, 3],[4, 5, 6]]
w=[[ 7, 8],[ 9, 10],[11, 12]]
b=[[3,3],[3,3]]
result1=tf.nn.xw_plus_b(x,w,[3,3])
result2=tf.matmul(x, w) + b
init_op = tf.initialize_all_variables() with tf.Session() as sess: # Run the init operation. sess.run(init_op) print(sess.run(result1)) print(sess.run(result2))
输出:
[[ 61 67][142 157]]
[[ 61 67][142 157]]
参考:https://www.w3cschool.cn/tensorflow_python/tf_nn_xw_plus_b.html
https://blog.csdn.net/ddy_sweety/article/details/80679077
[574]tf.nn.xw_plus_b相关推荐
- tf.nn.xw_plus_b真方便好用
望文生义就知道了这个函数什么用,x*w+b,就是这么回事. >>> help(tf.nn.xw_plus_b) Help on function xw_plus_b in modul ...
- tensorflow中tf.nn.xw_plus_b
tf.nn.xw_plus_b((x, weights) + biases) 相当于tf.matmul(x, weights) + biases #-*-coding:utf8-*- import t ...
- tensorflow函数 tf.nn.xw_plus_b
tf.nn.xw_plus_b((x, weights) + biases.) 相当于matmul(x, weights) + biases.
- tf.nn.xw_plus_b()
tf.nn.xw_plus_b() 函数原型: tf.nn.xw_plus_b(x, weights, biases, name=None) 作用: matmul(x, weights) + bias ...
- 深度学习原理与框架-CNN在文本分类的应用 1.tf.nn.embedding_lookup(根据索引数据从数据中取出数据) 2.saver.restore(加载sess参数)...
1. tf.nn.embedding_lookup(W, X) W的维度为[len(vocabulary_list), 128], X的维度为[?, 8],组合后的维度为[?, 8, 128] 代码说 ...
- 通俗理解tf.nn.conv2d() tf.nn.conv3d( )参数的含义 pytorhc 卷积
20210609 例如(3,3,(3,7,7))表示的是输入图像的通道数是3,输出图像的通道数是3,(3,7,7)表示过滤器每次处理3帧图像,卷积核的大小是3 x 7 x 7. https://blo ...
- 【Tensorflow】tf.nn.atrous_conv2d如何实现空洞卷积?膨胀卷积
介绍 关于空洞卷积的理论可以查看以下链接,这里我们不详细讲理论: 1.Long J, Shelhamer E, Darrell T, et al. Fully convolutional networ ...
- 【TensorFlow】理解tf.nn.conv2d方法 ( 附代码详解注释 )
最近在研究学习TensorFlow,在做识别手写数字的demo时,遇到了tf.nn.conv2d这个方法,查阅了官网的API 发现讲得比较简略,还是没理解.google了一下,参考了网上一些朋友写得博 ...
- tf.nn.embedding_lookup()的用法
函数: tf.nn.embedding_lookup( params, ids, partition_strategy='mod', name=None, validate_indices=True, ...
最新文章
- 北京钛谷诚泽网络通讯科技有限公司
- TensorFlow入门:Graph
- pip在安装模块时提示Read timed out
- struts2和springmvc的区别
- 小甲鱼python课后题答案_Python 小甲鱼教程 课后练习44
- Quartz.Net进阶之二:关于触发器的更多信息
- php-resque的设计和使用
- app运行租用服务器,app租用服务器
- OCS 2007 R2搭建准备虚机及快照
- 润乾报表-数据源的选取不能选视图
- 安装脚本实现百度云播放视频加速
- 带有风的诗词_2017含有风的诗句大全
- C# Graphics类详解
- 交易系统架构演进之路(二):2.0版
- 万向球头的锁紧结构图_联动锁紧球关节万向杆的制作方法
- win10c 系统语言 英文,Win10英文版系统下中文软件显示为问号的解决方法
- 计算机的基础单位和四种进制的基本知识
- IntelliJ IDEA自动去掉行尾空格
- 使用SMTP发送电子邮件
- 金融是不是一群不事生产的人,对社会毫无贡献的人,互相对赌的零和游戏?