当前位置:网站首页>tensorflow 张量做卷积,输入量与卷积核维度的理解
tensorflow 张量做卷积,输入量与卷积核维度的理解
2022-07-01 19:08:00 【河北一帆】
import tensorflow as tf
inputValue = tf.constant([
#1个张量
[
#3行3列2深度
[[2, 5], [3, 3], [8, 2]],
[[6, 1], [1, 2], [5, 4]],
[[7, 9], [2, 3], [-1, 3]]
]
])
kernels = tf.constant([
# 2行
[
# 2列
[
# 2深度
[3, 1, -3], [1, -1, 7]
],
[
[-2, 2, -5], [2, 7, 3]
]
],
[
# 2列
[
[-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)
红圈内表示每个张量的内容,蓝色圆圈圈出的中括号表示个数这个维度。
蓝色圈出的中括号表示行这个维度
红色表示列这个维度
红圈列里面的两个数字,表示深度是2
tf中,shape这样显示1个3行3列2深度的张量,在cnn训练中,minibatch有多个输入量,就在“1”这个 个数 维度上面增加
卷积核的维度
卷积核的维度(2,2,2,3),表示3个2行2列2深度的卷积核(行,列,深度,个数)
红色中括号代表行、蓝色代表列、黄色代表深度、深度内的三个数表示个数
validResult = tf.nn.conv2d(inputValue, kernels, [1, 1, 1, 1], "VALID")
“VALID”表示padding模式是valid,[1,1,1,1]表示在个数、行、列、深度这四个维度上的stride分别是1、1、1、1
边栏推荐
- RichView RichEdit SRichViewEdit PageSize 页面设置与同步
- PHP gets the external chain address of wechat applet and applet store
- Iframe parent-child page communication
- 牛客编程题--必刷101之字符串(高效刷题,举一反三)
- Target detection - Yolo series
- C#联合halcon应用——大华相机采集类
- How to turn off the boot auto start software in win11
- 强大、好用、适合程序员/软件开发者的专业编辑器/笔记软件综合评测和全面推荐
- 8K HDR!| Hevc hard solution for chromium - principle / Measurement Guide
- SQL getting started plan-1-select
猜你喜欢
如何用OpenMesh创建一个四棱锥
300题线性代数 第四讲 线性方程组
关联线探究,如何连接流程图的两个节点
Importance of EDA tools to chip industry knowledge popularization
RichView 文档中的 ITEM
[Mysql]安装Mysql5.7
RichView TRVDocParameters 页面参数设置
独家消息:阿里云悄然推出RPA云电脑,已与多家RPA厂商开放合作
STC 32-bit 8051 single chip microcomputer development example tutorial three program compilation setting and download
新牛牛盲盒微信小程序源码_支持流量变现,带完整素材图片
随机推荐
人脸识别系统 —— OpenCV人脸检测
Face recognition system opencv face detection
Items in richview documents
After adding cocoapods successfully, the header file cannot be imported or an error is reported in not found file
由浅入深学会白盒测试用例设计
Arduino stepper library drive 28byj-48 stepper motor test program
Hls4ml entry method
Keras machine translation practice
Keras机器翻译实战
关于new Set( )还有哪些是你不知道的
How can I know if I want to get the preferential link of stock account opening? Is it safe to open an account online?
EURA欧瑞E1000系列变频器使用PID实现恒压供水功能的相关参数设置及接线
架构师毕业总结
math_ Use differentiation to calculate approximate value
Use of common built-in classes of JS
【let var const】
Principle of motion capture system
Gaussdb (for MySQL):partial result cache, which accelerates the operator by caching intermediate results
Iframe 父子页面通信