当前位置:网站首页>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
边栏推荐
- The origin of usb-if Association and various interfaces
- 下载在线视频 m3u8使用教程
- Relevant settings of wechat applet cache expiration time (recommended)
- Leetcode skimming: binary tree 02 (middle order traversal of binary tree)
- excel查找与引用函数
- Leetcode skimming: stack and queue 04 (delete all adjacent duplicates in the string)
- [embedded system course design] a single key controls the LED light
- Leetcode 96 différents arbres de recherche binaires
- What does open loop and closed loop mean?
- Cmake engineering related
猜你喜欢

2022 pinduoduo details / pinduoduo product details / pinduoduo SKU details

2023款雷克萨斯ES产品公布,这回进步很有感

It's nothing to be utilitarian!

基于全志H3的QT5.12.9移植教程

下载在线视频 m3u8使用教程

SQL数据分析之流程控制语句【if,case...when详解】

BPR (Bayesian personalized sorting)
![[wechat authorized login] the small program developed by uniapp realizes the function of obtaining wechat authorized login](/img/c1/23be4399119f42d85a7b86fc8a59fc.png)
[wechat authorized login] the small program developed by uniapp realizes the function of obtaining wechat authorized login

Leetcode skimming: stack and queue 06 (top k high-frequency elements)

Use es to realize epidemic map or take out order function (including code and data)
随机推荐
Accelerator systems initiative is an independent non-profit organization
数据分析方法论与前人经验总结【笔记干货】
PHP reads ini or env type configuration
leetcode96不同的二叉搜索树
Intelligent operation and maintenance practice: banking business process and single transaction tracking
How to improve data quality
excel查找与引用函数
Flow control statement of SQL data analysis [if, case... When detailed]
Promise和模块块化编程
Shell process control
【底部弹出-选择器】uniapp Picker组件——底部弹起的滚动选择器
SQL Server 安装指南
Node - generate wechat permission verification configuration
The origin of usb-if Association and various interfaces
Window sorting functions rank and deny for SQL data analysis_ rank、raw_ Number and lag, lead window offset function [usage sorting]
Leetcode skimming: stack and queue 06 (top k high-frequency elements)
vue 强制清理浏览器缓存
LDR6035智能蓝牙音响可充可放(5.9.12.15.20V)快充快放设备充电
实例讲解将Graph Explorer搬上JupyterLab
Asp .NetCore 微信订阅号自动回复之文本篇