当前位置:网站首页>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
边栏推荐
- SwiftUI 4 新功能大全之 Toggle与 Mixed Toggle 多个绑定组件
- Learn white box test case design from simple to deep
- Easycvr accesses the equipment through the national standard gb28181 protocol. What is the reason for the automatic streaming of the equipment?
- 《软件工程导论(第六版)》 张海藩 复习笔记
- 实战项目笔记(一)——虚拟机的创建
- Customize the insertion of page labels and realize the initial search of similar address books
- [multithreading] lock strategy
-
- Simple but modern server dashboard dashdot
- 基于图的 Affinity Propagation 聚类计算公式详解和代码示例
猜你喜欢

升级版手机检测微信工具小程序源码-支持多种流量主模式

1592 example 1 King (sgu223 loj10170 luogu1896 increase + / provincial election -) violent thinking pressure DP 01 Backpack

Related concepts of cookies and sessions

深度学习 神经网络基础

走进如心小镇,数智化变革连接“未来社区”

Penetration tools - trustedsec's penetration testing framework (PTF)

宅男壁纸大全微信小程序源码-带动态壁纸支持多种流量主

强大的万年历微信小程序源码-支持多做流量主模式

喜马拉雅自研网关架构演进过程

Past and present life of product modular design
随机推荐
2022/6/8-2022/6/12
运动捕捉系统原理
牛客编程题--必刷101之字符串(高效刷题,举一反三)
Summary of SQL aggregate query method for yyds dry goods inventory
架构师毕业总结
internship:逐渐迈向项目开发
Win11 how to hide the taskbar? Win11 method to hide the taskbar
关于元宇宙下一代入口——脑机接口的实现
Arduino Stepper库驱动28BYJ-48步进电机测试程序
SwiftUI 4 新功能大全之 Toggle与 Mixed Toggle 多个绑定组件
STC 32-bit 8051 single chip microcomputer development example tutorial three program compilation setting and download
极客DIY开源方案分享——数字幅频均衡功率放大器设计(实用的嵌入式电子设计作品软硬件综合实践)
ORA-01950
实战项目笔记(一)——虚拟机的创建
uniapp使用腾讯地图选点 没有window监听回传用户的位置信息,怎么处理
3D panoramic model display visualization technology demonstration
Interesting! Database is also serverless!
How can I know if I want to get the preferential link of stock account opening? Is it safe to open an account online?
【let var const】
Win11怎么关闭开机自启动软件