首页 > 解决方案 > 我需要一些关于 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

这是我引用的图像。

在此处输入图像描述

欢迎任何批评。这是真的。

标签: pythontensorflowdeep-learningconvolution

解决方案


我没有测试您的代码,但据我了解,在 for 循环中选择特征时,您使用 3 维并将 c 放入第 3 维,但据我所知,3D 卷积是 4D,因此如果添加额外的维度是正确的。我将很快测试和编辑您的代码。


推荐阅读