当前位置:网站首页>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
边栏推荐
- Mysql database driver (JDBC Driver) jar package download
- SQL数据分析之窗口排序函数rank、dense_rank、raw_number与lag、lead窗口偏移函数【用法整理】
- What does open loop and closed loop mean?
- leetcode96不同的二叉搜索樹
- Leetcode skimming: stack and queue 03 (valid parentheses)
- Leetcode medium question sharing (5)
- ERP项目施行计划的目的是什么?
- LeetCode中等题题分享(5)
- Linux CentOS7安装Oracle11g的超完美新手教程
- 创业团队如何落地敏捷测试,提升质量效能?丨声网开发者创业讲堂 Vol.03
猜你喜欢

Mysql database driver (JDBC Driver) jar package download

SQL Server 安装指南

Intelligent operation and maintenance practice: banking business process and single transaction tracking

sso单点登录的实现。

The new version of graphic network PDF will be released soon

PWN attack and defense world cgpwn2

How do Lenovo computers connect Bluetooth headsets?

Leetcode skimming: binary tree 03 (post order traversal of binary tree)

USB-IF协会与各种接口的由来

Selectively inhibiting learning bias for active sampling
随机推荐
Operate database transactions with jpatractionmanager
SQL Server 安装指南
When installing mysql, there are two packages: Perl (data:: dumper) and Perl (JSON)
If the browser is accidentally closed, how does react cache the forms filled out by users?
vue 强制清理浏览器缓存
2023 Lexus ES products have been announced, which makes great progress this time
449-原码、补码、反码
Leetcode skimming: binary tree 02 (middle order traversal of binary tree)
I would like to ask, which securities is better for securities account opening? Is it safe to open a mobile account?
What does open loop and closed loop mean?
Correlation - intra group correlation coefficient
Node -- add compressed file
From 20s to 500ms, I used these three methods
Leetcode skimming: stack and queue 03 (valid parentheses)
Record the accidental success and failure of uploading large files
Promise and modular programming
Database -- sqlserver details
leetcode96不同的二叉搜索樹
How to open an account for individual stock speculation? Is it safe?
使用 ES 实现疫情地图或者外卖点餐功能(含代码及数据)