python - 我需要一些关于 tensorflow 中分离 3D 卷积的帮助
问题描述
我是学生,正在学习深度神经网络。
我看到一篇论文,标题是:
“ 3D 深度卷积:减少 3D 视觉任务中的模型参数”
我需要实现本文介绍的 3D Separable Convolution。
我希望你指出我的消息来源。
separable_conv3d.py
def separable_conv3d(input, output_dim, depth_filter_channel=1, strides=1, padding='SAME', name=None):
input_tensor_channel = input.get_shape().as_list()[-1]
kernel1 = tf.Variable(tf.truncated_normal(shape=[batch_frame, 3, 3, input_tensor_channel, depth_filter_channel], stddev=0.1))
feature_list = []
for c in range(0, len(input_tensor_channel)):
feature1 = conv3d(input.shape[:, :, c], weight=kernel1, strides=strides, padding=padding, name=name)
feature_list.append(feature1)
total_feature = tf.concat(feature_list, axis=-1)
total_tensor_channel = total_feature.get_shape().as_list()[-1]
kernel3 = tf.Variable(tf.truncated_normal(shape=[1, 1, 1, total_tensor_channel, output_dim]))
pw1 = conv3d(input=total_feature, weight=kernel3, strides=strides, padding=padding, name=name)
return pw1
这是我引用的图像。
欢迎任何批评。这是真的。
解决方案
我没有测试您的代码,但据我了解,在 for 循环中选择特征时,您使用 3 维并将 c 放入第 3 维,但据我所知,3D 卷积是 4D,因此如果添加额外的维度是正确的。我将很快测试和编辑您的代码。
推荐阅读
- python - 每天从 url 抓取不同的图像
- amazon-web-services - AWS Api Gateway - 验证传入的 XML 有效负载
- javascript - 如何创建覆盖响应状态代码但保留其余响应的 Cloudflare 工作程序?
- stm32 - STM32F7 + FatFs = FR_NOT_READY
- swift - UIViewPropertyAnimator 自动布局完成问题
- android - Android处理文件路径问题
- javascript - 在现有 iframe 中切换 src
- sql-server - 将 2010 SQL Native Client 11.0 链接到 SQL Server 2000 以获取报告
- safari - 如何让 URL.createObjectURL(blob) 在 Safari 中工作
- django - Django Heroku 无法验证第一个证书