dragen1860 / capsnet-pytorch Goto Github PK
View Code? Open in Web Editor NEWPytorch version of Hinton's Capsule Theory paper: Dynamic Routing Between Capsules
Pytorch version of Hinton's Capsule Theory paper: Dynamic Routing Between Capsules
你的输出是8个1152为的胶囊,但是原文想表达的应该是1152个8维的向量,虽然整体标量个数一样,但是你的squash函数就成了对一个1152为的函数的作用了,文章肯定是希望对一个8维向量作用。个人拙见。
hi,i think you mix up mod and mod_sq in the squeeze function, it would be great that you check if i am right
Hi! Thank you for your code. I got the error when I run your code. Can you help please to sort out the problem?
Traceback (most recent call last):
File "main.py", line 220, in
output = net(data)
File "/home/user/pytorch_python3/lib/python3.5/site-packages/torch/nn/modules/module.py", line 224, in call
result = self.forward(*input, **kwargs)
File "main.py", line 71, in forward
return self.net(input)
File "/home/user/pytorch_python3/lib/python3.5/site-packages/torch/nn/modules/module.py", line 224, in call
result = self.forward(*input, **kwargs)
File "/home/user/pytorch_python3/lib/python3.5/site-packages/torch/nn/modules/container.py", line 67, in forward
input = module(input)
File "/home/user/pytorch_python3/lib/python3.5/site-packages/torch/nn/modules/module.py", line 224, in call
result = self.forward(*input, **kwargs)
File "main.py", line 120, in forward
u_hat = torch.matmul(torch.cat([self.W] * self.batch_size, 0) , input)
File "/home/user/pytorch_python3/lib/python3.5/site-packages/torch/functional.py", line 214, in matmul
expand_batch_portion = torch._C._infer_size(tensor1_exp_size[:-2], tensor2_exp_size[:-2])
RuntimeError: The size of tensor a (50) must match the size of tensor b (100) at non-singleton dimension 0.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.