Pytorch-CapsuleNet icon indicating copy to clipboard operation
Pytorch-CapsuleNet copied to clipboard

An easy-to-follow Pytorch implementation of Hinton's Capsule Network

Results 8 Pytorch-CapsuleNet issues
Sort by recently updated
recently updated
newest added

Instead of creating the matrix W, a large matrix, I have calculated the matrix multiplication in an iterative way. So for batch size 100, the memory allocation has reduced from...

File "C:\Users\23671\Desktop\CNN\self_conv\DDR\CNN_2d.py", line 405, in forward u = u.view(x.size(0), self.num_routes, -1) RuntimeError: shape '[2, 1152, -1]' is invalid for input of size 1125888 When applied to my own dataset, the...

Hello, I tried to test your code but after a few epochs (8 at most) the loss of the network turns out to be NaN. Has anyone else faced this...

目前看到的多个版本胶囊网络都是在前N-1次迭代时停止u_hat的梯度,只在最后一次开放梯度。只有作者这个版本没有这样操作,请问作者是否清楚这里的原因

``` b_ij = b_ij + a_ij.squeeze(4).mean(dim=0, keepdim=True) ```

https://github.com/jindongwang/Pytorch-CapsuleNet/blob/93996119a224e9c3d274df88735f1acb36592d97/capsnet.py#L79 To make it stable, following is suggested: ```python def squash(self, input_tensor, epsilon=1e-7): squared_norm = (input_tensor ** 2 + epsilon).sum(-1, keepdim=True) output_tensor = squared_norm * input_tensor / ((1. + squared_norm)...

In file capsnet.py => function squash, ``` def squash(self, input_tensor): print(f'input_tensor.shape: {input_tensor.shape}') squared_norm = (input_tensor ** 2).sum(-1, keepdim=True) print(f'squared_norm.shape: {squared_norm.shape}') ``` Print out : ``` input_tensor.shape: torch.Size([100, 1, 10, 16,...