Git Product home page Git Product logo

lightcapsnet's Introduction

LightCapsNet(testing stage)

A Matlab implementation of CapsNet in the paper:
Sara Sabour, Nicholas Frosst, Geoffrey E Hinton. Dynamic Routing Between Capsules. NIPS 2017

The network is implemented in the hard way. The back propagation is first derived by hand and then implemented.

At this time the an MLP capsule network and CNN capsult network is implemented in the tests. The 'dynamic routing' is still in development. One simple example is provided and it is likely to be a new hardware killer.

Collaborations and contributions are very welcome.

This project is based on LightNet.

lightcapsnet's People

Contributors

yechengxi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lightcapsnet's Issues

How to fix the bug in conv_2d. file regarding PADDING_MODE?

The error is still now in LightCapsNet. Please help me to fix the bug or update the conv_2d. file in LightCapsNet.

Please help me to fix the following bug in LightCapsNet:
Undefined function or variable
'PADDING_MODE'.

Error in conv_layer_2d (line 60)
if PADDING_MODE==1

Error in net_bp (line 39)
[res(layer).dzdx,
res(layer).dzdw,res(layer).dzdb,opts]
= conv_layer_2d(
res(layer).x,net.layers{layer}.weights{1},net.layers{layer}.weights{2},net.layers{layer}.stride,net.layers{layer}.pad,res(layer+1).dzdx,opts
);

Error in select_learning_rate (line
59)
[ net,res,opts ] =
net_bp( net,res,opts
);

Error in selective_sgd (line 13)
[lr_best]=select_learning_rate(net,opts);

Error in train_net (line 26)
[ net,opts ] = selective_sgd(
net,opts );

Error in TrainingScript (line 46)
[net,opts]=train_net(net,opts);

Error in Main_Template (line 128)
TrainingScript();

Error in Main_MNIST_Conv_Capsules
(line 30)
Main_Template(); %call training
template

Problem occurred in conv_layer_2d. Can you help me here?

Array dimensions must match for binary array op.

Error in conv_layer_2d (line 115)
y=y+bias_p;

Error in net_ff (line 39)
[res(layer+1).x,,,opts] = conv_layer_2d(
res(layer).x,net.layers{layer}.weights{1},net.layers{layer}.weights{2},net.layers{layer}.stride,net.layers{layer}.pad,[],opts
);

Error in select_learning_rate (line 52)
[ net,res,opts ] = net_ff( net,res,opts );

Error in selective_sgd (line 13)
[lr_best]=select_learning_rate(net,opts);

Error in train_net (line 26)
[ net,opts ] = selective_sgd( net,opts );

Error in TrainingScript (line 46)
[net,opts]=train_net(net,opts);

Error in Main_Template (line 128)
TrainingScript();

Error in Main_MNIST_Conv_Capsules (line 30)
Main_Template(); %call training template

Error in RunAll (line 10)
Main_MNIST_Conv_Capsules()

using the network

my problem is in testing the network, I have tried to use " predict " command but it does not predict.

predict (net,x)
Error using predict (line 126)
No valid system or dataset was specified.

this is the message.

Undefined variable "nnet" or class "nnet.internal.cnn.layer.Convolution2D"

Hi,thank you very much for your code,I ran your code but it gave me the error:

Undefined variable "nnet" or class "nnet.internal.cnn.layer.Convolution2D"
conv_layer_2d (line 36)
opts.layer{opts.current_layer}.conv2d_nntb=nnet.internal.cnn.layer.Convolution2D('conv2d_nntb', [k1,k2], k3,k4, [stride(1),stride(2)], pad(1:2:end));

I can't find the solution about it and I hope I can get your generous help.
thanks a lot!

Running CapsNet

Hi,

I tried to run the RunAll and I got the following error:


>> RunAll
Training a non-convolutional CapsNet.

use_gpu =

     1


opts = 

    use_nntoolbox: 1

Undefined variable "nnet" or class "nnet.internal.cnn.layer.Convolution2D".

Error in linear_layer (line 17)
            opts.layer{opts.current_layer}.fc_nntb=nnet.internal.cnn.layer.Convolution2D('conv2d_nntb', [1,1], in ,out, [1,1], [0,0]);

Error in net_ff (line 56)
                [res(layer+1).x,~,~,opts] = linear_layer( res(layer).x,net.layers{layer}.weights{1},net.layers{layer}.weights{2},[], opts );

Error in select_learning_rate (line 52)
                [ net,res,opts ] = net_ff( net,res,opts );

Error in selective_sgd (line 13)
        [lr_best]=select_learning_rate(net,opts);

Error in train_net (line 26)
        [ net,opts ] = selective_sgd( net,opts );

Error in TrainingScript (line 46)
    [net,opts]=train_net(net,opts);

Error in Main_Template (line 128)
    TrainingScript();

Error in Main_MNIST_MLP_Capsules (line 30)
Main_Template(); %call training template

Error in RunAll (line 4)
Main_MNIST_MLP_Capsules();

Does anyone know why I'm getting this error?
Best regards.

EDIT

This issue was already answered here

MLP Capsule Network Questions

Hi there,

Awesome repository. I've been trying to implement an MLP based caps net, where the primary caps analyzes subsets of features in groups, feeding them into MLPs per capsule then pushed to downstream capsules.

For some reason, I am getting terrible results. Do you know what I might be doing wrong?

What are areas that make MLP capsules different from CNN capsules, what should I be aware of? How do I optimize to get good results. I think dynamic routing is essential for establishment of hierarchy, but in the non-image context, I'm unsure of how the affine transformation is helpful.

My implementation is in pytorch.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.