当前位置:网站首页>Tensorflow tensor convolution, input and convolution kernel dimension understanding
Tensorflow tensor convolution, input and convolution kernel dimension understanding
2022-07-02 00:34:00 【Hebei Yifan】
import tensorflow as tf
inputValue = tf.constant([
#1 A tensor
[
#3 That's ok 3 Column 2 depth
[[2, 5], [3, 3], [8, 2]],
[[6, 1], [1, 2], [5, 4]],
[[7, 9], [2, 3], [-1, 3]]
]
])
kernels = tf.constant([
# 2 That's ok
[
# 2 Column
[
# 2 depth
[3, 1, -3], [1, -1, 7]
],
[
[-2, 2, -5], [2, 7, 3]
]
],
[
# 2 Column
[
[-1, 3, 1], [-3, -8, 6]
],
[
[4, 6, 8], [5, 9, -5]
]
]
])
validResult = tf.nn.conv2d(inputValue, kernels, [1, 1, 1, 1], "VALID")
print(validResult)

The contents of each tensor are represented in the red circle , The square brackets circled by the blue circle indicate the dimension of number .

The brackets circled in blue indicate the dimension of row

Red indicates the dimension of column
The two numbers in the red circle column , Indicates that the depth is 2

tf in ,shape This shows 1 individual 3 That's ok 3 Column 2 Tensor of depth , stay cnn In training ,minibatch There are multiple inputs , It's just “1” This Number Add
The dimension of convolution kernel

The dimension of convolution kernel (2,2,2,3), Express 3 individual 2 That's ok 2 Column 2 Convolution kernel of depth ( That's ok , Column , depth , Number )

Red brackets represent lines 、 Blue represents column 、 Yellow represents depth 、 Three numbers in the depth represent numbers
validResult = tf.nn.conv2d(inputValue, kernels, [1, 1, 1, 1], "VALID")“VALID” Express padding The pattern is valid,[1,1,1,1] It means in number 、 That's ok 、 Column 、 Depth in these four dimensions stride Namely 1、1、1、1
边栏推荐
- 启牛学院开户安全的吗?开户怎么开?
- PWN attack and defense world cgpwn2
- Intelligent operation and maintenance practice: banking business process and single transaction tracking
- The origin of usb-if Association and various interfaces
- [wechat authorized login] the small program developed by uniapp realizes the function of obtaining wechat authorized login
- Leetcode skimming: stack and queue 02 (realizing stack with queue)
- Linux CentOS7安装Oracle11g的超完美新手教程
- Leetcode skimming: stack and queue 06 (top k high-frequency elements)
- Leetcode skimming: stack and queue 05 (inverse Polish expression evaluation)
- vue 强制清理浏览器缓存
猜你喜欢

Leetcode skimming: stack and queue 04 (delete all adjacent duplicates in the string)

数据分析方法论与前人经验总结【笔记干货】

2022拼多多详情/拼多多商品详情/拼多多sku详情
![[bottom pop-up selector] uniapp picker component - scroll selector popped up at the bottom](/img/d4/9d27b29080ce83004aa875a499de9b.png)
[bottom pop-up selector] uniapp picker component - scroll selector popped up at the bottom

Review data desensitization system

2023 Lexus ES products have been announced, which makes great progress this time

excel数据透视表

What is ThreadLocal memory leak and how to solve it

export default 导出的对象,不能解构问题,和module.exports的区别

Using multithreaded callable to query Oracle Database
随机推荐
Database -- sqlserver details
Kyushu cloud and Intel jointly released the smart campus private cloud framework, enabling new infrastructure for education
Is it safe to buy funds in a securities account? Where can I buy funds
GaussDB(for MySQL) :Partial Result Cache,通过缓存中间结果对算子进行加速
Niuke - Practice 101 - reasoning clown
js 公共库 cdn 推荐
Leetcode skimming: binary tree 02 (middle order traversal of binary tree)
RFID让固定资产盘点更快更准
Asp . Text of automatic reply to NETCORE wechat subscription number
Graduation season is both a farewell and a new beginning
Export default the exported object cannot be deconstructed, and module Differences between exports
一个实习生的CnosDB之旅
EMC circuit protection device for surge and impulse current protection
vue 强制清理浏览器缓存
【模板】自适应辛普森积分
Gaussdb (for MySQL):partial result cache, which accelerates the operator by caching intermediate results
Download the online video m3u8 tutorial
Heketi record
How do Lenovo computers connect Bluetooth headsets?
Vue force cleaning browser cache