leftthomas / capsnet Goto Github PK
View Code? Open in Web Editor NEWA PyTorch implementation of CapsNet based on NIPS 2017 paper "Dynamic Routing Between Capsules"
License: MIT License
A PyTorch implementation of CapsNet based on NIPS 2017 paper "Dynamic Routing Between Capsules"
License: MIT License
a sample can be classify correctly, but confidence is small
Hi @leftthomas
the part of reconstruction for Capsnet works out by using nn.Linear as the last layer in self.decoder and for MNIST dataset, it is 784 output channel.
However, if we want to implement Capsnet to another image classification dataset such as 256*256 colored images, whether it has too much paremeters to be trained for reconstruction part. What should we do when facing this problem?
Very appreciate!
sorry to say that (maybe it's my fault) , my problem is that nothing happens in visdom enviroment here : http://127.0.0.1:8097/ .
I don't know maybe some time I should wait to get the result .
File "/home/lxt/pytorch/CapsNet/main.py", line 45, in
digit_caps = model(data, target)
File "/home/lxt/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 224, in call
result = self.forward(*input, **kwargs)
File "/home/lxt/pytorch/CapsNet/capsnet.py", line 29, in forward
digit_caps = self.digit_caps(primary_caps)
File "/home/lxt/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 224, in call
result = self.forward(*input, **kwargs)
File "/home/lxt/pytorch/CapsNet/functions.py", line 53, in forward
pred = [self.Wi for i, group in enumerate(u) for in_vec in group]
File "/home/lxt/pytorch/CapsNet/functions.py", line 53, in
pred = [self.Wi for i, group in enumerate(u) for in_vec in group]
File "/home/lxt/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 224, in call
result = self.forward(*input, **kwargs)
File "/home/lxt/anaconda3/lib/python3.6/site-packages/torch/nn/modules/linear.py", line 53, in forward
return F.linear(input, self.weight, self.bias)
File "/home/lxt/anaconda3/lib/python3.6/site-packages/torch/nn/functional.py", line 555, in linear
output = input.matmul(weight.t())
File "/home/lxt/anaconda3/lib/python3.6/site-packages/torch/autograd/variable.py", line 560, in matmul
return torch.matmul(self, other)
File "/home/lxt/anaconda3/lib/python3.6/site-packages/torch/functional.py", line 168, in matmul
return torch.mm(tensor1.unsqueeze(0), tensor2).squeeze_(0)
File "/home/lxt/anaconda3/lib/python3.6/site-packages/torch/autograd/variable.py", line 579, in mm
return Addmm.apply(output, self, matrix, 0, 1, True)
File "/home/lxt/anaconda3/lib/python3.6/site-packages/torch/autograd/_functions/blas.py", line 26, in forward
matrix1, matrix2, out=output)
TypeError: torch.addmm received an invalid combination of arguments - got (int, torch.cuda.FloatTensor, int, torch.cuda.FloatTensor, torch.FloatTensor, out=torch.cuda.FloatTensor), but expected one of:
torch version 2.0.3 , I try both python3 and python2
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.