胶囊网络参数

Capsule network parameters

我找到了用于 MNIST 数据集的参数如下

# Parameters Based on Paper
epsilon = 1e-7
m_plus = 0.9
m_minus = 0.1
lambda_ = 0.5
alpha = 0.0005
epochs = 3
no_of_secondary_capsules = 10
params = {
    "no_of_conv_kernels": 256,
    "no_of_primary_capsules": 64,
    "no_of_secondary_capsules": 128,
    "primary_capsule_vector": 16,
    "secondary_capsule_vector": 32,
    "r":3,
}

MNIST 的输入形状是 28,28,1

我希望此参数更改为形状为 13,9,1 的输入数据 因为当我将 MNIST 参数用于胶囊网络时,它会抛出关于形状的错误

ValueError: Exception encountered when calling layer "primary_caps" (type PrimaryCaps).

    in user code:
    
        File "/content/Efficient-CapsNet/utils/layers_hinton.py", line 69, in call  *
            x = tf.nn.conv2d(inputs, self.kernel, self.s, 'VALID')
    
        ValueError: Negative dimension size caused by subtracting 9 from 5 for '{{node primary_caps/Conv2D}} = Conv2D[T=DT_FLOAT, data_format="NHWC", dilations=[1, 1, 1, 1], explicit_paddings=[], padding="VALID", strides=[1, 2, 2, 1], use_cudnn_on_gpu=true](Placeholder, primary_caps/Conv2D/ReadVariableOp)' with input shapes: [?,5,11,256], [9,9,256,256].
    
    
    Call arguments received:
      • inputs=tf.Tensor(shape=(None, 5, 11, 256), dtype=float32)

有人可以建议胶囊网络的参数吗?

数据是音频 (13,9,1),因此将其转换为频谱图图像,然后以目标大小 (28,28) 读取它帮助我解决了将胶囊网络用于音频数据集的问题。

如果您想使用带有动态路由文件的胶囊网络的原始超参数和网络设计,可以使用此解决方法。