gram-ai / capsule-networks

A PyTorch implementation of the NIPS 2017 paper "Dynamic Routing Between Capsules".
https://arxiv.org/abs/1710.09829
1.73k stars 316 forks source link

Technical doubts regarding implementation #7

Open JoaoLages opened 6 years ago

JoaoLages commented 6 years ago

Thanks for making this repository, really useful :)

Let me start with the questions:

  1. Is this network specifically done for 28x28 images or would it work for other sizes? The same goes for the number of channels, if self.conv1 = nn.Conv2d(in_channels=3, out_channels=256, kernel_size=9, stride=1) is used instead, will it work for images with 3 channels or is it necessary to make other changes?

  2. In self.digit_capsules = CapsuleLayer(num_capsules=NUM_CLASSES, num_route_nodes=32 * 6 * 6, in_channels=8, out_channels=16), why did you choose 32x6x6 num_route_nodes? I am trying this code with different data and stuck in this step as the image dimensions are different and idk how they relate with this hyperparameter.

  3. By increasing num_iterations will the model's performance increase as well?