Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusion in variable names #171

Open
Addhi86 opened this issue Jan 6, 2017 · 5 comments
Open

Confusion in variable names #171

Addhi86 opened this issue Jan 6, 2017 · 5 comments

Comments

@Addhi86
Copy link

Addhi86 commented Jan 6, 2017

Hello,

I have started learning about the deep learning, I have downloaded this toolbox.
To understand about the CNN I have started with the 'test_example_CNN' I am confused about these variables
train_x, test_x, train_y, test_y
why it is with 'x' and 'y'
Also what is cnnsetup?

@wajihullahbaig
Copy link

Those are the very basic things my friend. You need to go through the understanding the mnist dataset.
You can find the dataset under 'data' folder. The dataset is divided into training and testing sets.
Training sets have images and labels, testing sets have images only for which a label is predicted.
Hope this helps. If you are comfortable with python, You can find a python translation of the code here.
https://github.com/wajihullahbaig/DeepNeuralNetworks

@Addhi86
Copy link
Author

Addhi86 commented Jan 11, 2017

Thanks Wajihullah baig, Yes, you are right it was the basic query.
i am more comfortable with MATLAB.
some other things which I want to know is:

  1. struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer
    I have confusion in understanding what is meant by 'outputmaps'? 'kernelsize' 5 mean the filter size is 5x5.

  2. struct('type', 's', 'scale', 2) %sub sampling layer
    This sub sampling layer with the size 2x2? is it possible to add ReLu layer?

  3. What is opt.alpha?

  4. In the test_example_CNN if i add more convolution and sub sampling layer I got an error. what is the reason?

cnn.layers = {
    struct('type', 'i') %input layer
    struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer
    struct('type', 's', 'scale', 2) %sub sampling layer
    struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer
    struct('type', 's', 'scale', 2) %sub sampling layer
    struct('type', 'c', 'outputmaps', 18, 'kernelsize', 5) %convolution layer
    struct('type', 's', 'scale', 2) %subsampling layer
};

Error:
Array dimensions must match for binary array op.

Error in cnnbp (line 32)
z = z + convn(net.layers{l + 1}.d{j}, rot180(net.layers{l + 1}.k{i}{j}), 'full');

Error in cnntrain (line 17)
net = cnnbp(net, batch_y);

Error in test_example_CNN (line 31)
cnn = cnntrain(cnn, train_x, train_y, opts);

@wajihullahbaig
Copy link

wajihullahbaig commented Jan 12, 2017

You should first understand the concepts of convolutional networks. Its too lengthy to explain here. Once you grasp the ideas, you will note that it is easy to follow code or write your own. I suggest you read about them from link/blogs/videos by andrej karpathy.

@Addhi86
Copy link
Author

Addhi86 commented Jan 12, 2017

Thanks I will check that.. Is it too lengthy to give answer of each question?

@wajihullahbaig
Copy link

You can add any sorts of layers - Just make sure you dont break the code. A ReLU is a good idea.
I am note sure why you are getting array dimension errors, possibly your data that is being convolved with a filter is some how mismatched in terms of dimensions. You should check if convn() function parameters accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants