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

changed the matrix multiplication in line 60 for better performance

Open Z4HRA-S opened this issue 2 years ago • 1 comments

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 562 MiB to 141 MiB

Z4HRA-S avatar Dec 12 '22 17:12 Z4HRA-S

There exists a trade-off between computational efficiency and memory usage when multiplying two matrices together. In many cases, performing matrix multiplication in parallel can result in significantly quicker results compared to sequentially applying each element of one or both vectors individually. So I would make your approach optional, not forced.

filonenkoa avatar May 20 '23 12:05 filonenkoa