当前位置:网站首页>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
边栏推荐
- 智能运维实战:银行业务流程及单笔交易追踪
- 启牛学院开户安全的吗?开户怎么开?
- [cascade classifier training parameters] training Haar cascades
- 一个实习生的CnosDB之旅
- RFID makes the inventory of fixed assets faster and more accurate
- heketi 记录
- Linux centos7 installation Oracle11g super perfect novice tutorial
- Node——Egg 创建本地文件访问接口
- Use es to realize epidemic map or take out order function (including code and data)
- Asp .NetCore 微信订阅号自动回复之文本篇
猜你喜欢

如何提升数据质量

Leetcode question brushing: stack and queue 07 (maximum value of sliding window)

Promise和模块块化编程

The new version of graphic network PDF will be released soon

Leetcode skimming: stack and queue 03 (valid parentheses)

Kuberntes cloud native combat high availability deployment architecture

sso单点登录的实现。
![Data analysis methodology and previous experience summary [notes dry goods]](/img/00/e4c4cf37f1ca9134546f970d800226.png)
Data analysis methodology and previous experience summary [notes dry goods]

SQL Server Installation Guide

How to type spaces in latex
随机推荐
Node -- add compressed file
[QT] QT cannot find a solution to the compiler using msvc2017
Halcon knowledge: an attempt of 3D reconstruction
The new version of graphic network PDF will be released soon
【opencv】train&test HOG+SVM
Correlation - intra group correlation coefficient
启牛商学院给的证券账户安不安全?哪里可以开户
挖财学堂开户打新债安全可靠嘛?
[opencv450] hog+svm and hog+cascade for pedestrian detection
Review data desensitization system
Node——生成微信权限验证配置
Ldr6035 smart Bluetooth audio can be charged and released (5.9.12.15.20v) fast charging and fast releasing device charging
vue 强制清理浏览器缓存
Ldr6035 smart Bluetooth audio can continuously charge and discharge mobile devices
Accelerator systems initiative is an independent non-profit organization
Flow control statement of SQL data analysis [if, case... When detailed]
Take the enclave Park as a sample to see how Yuhua and Shaoshan play the song of Chang Zhu Tan integrated development
【CTF】bjdctf_ 2020_ babystack2
Graduation season is both a farewell and a new beginning
ThreadLocal内存泄漏是什么,怎么解决