i have found the parameters used for MNIST dataset which is as below
# 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,
}
the input shape for MNIST is 28,28,1
I want this parameters change for my input data shaped as 13,9,1 because when I use the MNIST parameters for capsule network it throws error about the shape
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)
can someone suggest parameters for capsule network?
The data was audio (13,9,1) so converting it to spectrogram image and then reading it with target size (28,28) helped me workaround the issue of using capsule network for the audio dataset.
This workaround can be used if you want to go with the original hyperparameters and network designs of the capsule network with dynamic routing paper.