tf.pad(input, paddings, name=None) 解析
来源:互联网 发布:淘宝用vr试穿 编辑:程序博客网 时间:2024/05/29 17:01
tf.pad(input, paddings, name=None)
官方解释:
Pads a tensor with zeros.
This operation pads a input with zeros according to the paddings you specify. paddings is an integer tensor with shape [Dn, 2], where n is the rank of input. For each dimension D of input, paddings[D, 0]indicates how many zeros to add before the contents of input in that dimension, and paddings[D, 1]indicates how many zeros to add after the contents of input in that dimension.
用例子解释一下,比如说 :
input = [[1, 1], [2, 2]] , shape =(2,2)paddings = [[1, 1], [2, 2]] pad(t, paddings) ==> [[0, 0, 0, 0, 0] [0, 0, 0, 0, 0] [0, 1, 1, 0, 0] [[0, 2, 2, 0, 0] [0, 0, 0, 0, 0]]
依次解释上面的英文:
paddings is an integer tensor with shape [Dn, 2]: 例子中 这个就是 [2, 2]
where n is the rank of input.: 其实就是输入的维度,有2维,所以Dn = 2
For each dimension D of input, paddings [D, 0] indicates how many zeors to add before the contents of input in that dimension :比如对于输入的第一维,这里也就代表行,那paddings[D, 0]代表:paddings [0, 0] ,paddings=[[1, 1], [2, 2]], paddings[0,0]索引的是[1,1] 左边的1。 也就是说,这个左边的1表示,在0这个维度(行)的前面(上面)加1个0。而paddings[1, 0] 索引的是 [2,2] 左边的2。表示在1这个维度(列)的前面(左面)加2个0.
and paddings[D, 1]indicates how many zeros to add after the contents of input in that dimension. : 这个就也好理解 了。 比如D=0, paddings[0,1]索引的是 [1,1]右边的1, 这个1表示的是,在0这个维度(行)的后面(下面)加1个0。 而paddings[1,1]索引的是[2,2]右边的2。表示在1这个维度(列)的后面(右面)加2个0。
PS:有不对的请指出
- tf.pad(input, paddings, name=None) 解析
- tf.reduce_mean(input,axis=None,keep_dims=False,name=None,reduction_indices=None)
- tf.argmax(input, axis=None, name=None, dimension=None)
- tf.gather_nd(params, indices, name=None)
- tf.is_finite(x, name=None)
- tf.equal(x, y, name=None)
- tf.cast(x,dtype,name=None )
- tensorflow tf.pad解析
- tf.nn.conv2d(input, filter, strides, padding, use_cudnn_on_gpu=None, name=None) 除去name参数用以指定该操作的nam
- tf.segment_sum(data, segment_ids, name=None)介绍
- tensorflow tf.equal(x, y, name=None)
- tensorflow 中tf.gather(params, indices, validate_indices=None, name=None) 函数讲解
- tensorflow tf.logical_and(True, False) tf.logical_not(x, name=None)
- tf.nn.atrous_conv2d(value, filters, rate, padding, name=None) {#atrous_conv2d}
- [TensorFlow 学习笔记-08]tf.pad函数源码解析
- input[name='']与input:[name='']
- tf.one_hot(indices, depth, on_value=None, off_value=None, axis=None)
- 使用 googlebreak pad 解析 crash
- 获取pdf文件的总页数
- 罗斯基的机器学习(一)感知机
- 【Maven】Maven系列(一)——环境安装配置和新建maven项目
- 无法打开sql server 数据库
- windows2003 修改RDP超时和最大远程用户数
- tf.pad(input, paddings, name=None) 解析
- poj1743-后缀数组
- sql server 如何预防被探测密码
- Unity2D的碰撞事件解析
- Mysql: Authentication with old password no longer supported, use 4.1 style password
- git团队开发
- Mysql: The located assembly's manifest definition does not match the assembly reference
- Android 调用系统播放器播放视频
- VS2017编译boost库