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

Explanation for Training and Classes #10

Closed
mixkter opened this issue Feb 3, 2017 · 3 comments
Closed

Explanation for Training and Classes #10

mixkter opened this issue Feb 3, 2017 · 3 comments

Comments

@mixkter
Copy link

mixkter commented Feb 3, 2017

This basic example program is the skeleton of a classification problem.
The training data should be in matrix form, where each row is a data point, and
each column is a feature.
The training classes should be in matrix form, where the ith row corresponds to
the ith training example, and each column is a 1 if it is of that class, and
0 otherwise. Each example may only be of 1 class.

This isn't clear to me. Let's say I have a training data set with 8 features
And I want them classified into 4 classes

Training - rows of eight columns one feature per column
1,2,3,4,5,6,7,8
6,2,3,4,7,6,5,4
6,2,3,4,4,5,5,4
3,4,7,6,5,4,3,2
2,3,4,5,6,4,3,3

Classifications - since I have four classes I would think this has 4 columns, each column indicating which class it is in
0,0,1,0
1,0,0,0
1,0,0,0
0,1,0,0
0,0,01
That's five rows and 4 columns. One column per class.

Create network would be:
createNetwork(8, 1, hiddenSizeReg, hiddenActivationsReg, 4, linear);
Network with 8 inputs 1 hidden layer and 4 outputs (1 per class)

But accuracy requires this:
assert(data->cols == network->layers[network->numLayers - 1]->size);

Can you give a better example?

Thanks

@100
Copy link
Owner

100 commented Feb 4, 2017

My mistake, I forgot to write a unit test for that function.

It should be assert(classes->cols == network->layers[network->numLayers - 1]->size);.

Feel free to send a PR or I can fix it later on my own.

@mixkter
Copy link
Author

mixkter commented Feb 5, 2017

I made quite a few other changes including support for doubles or floats, CUDA BLAS, and renamed a lot of stuff. A PR would be a huge change for you.

Thanks for fix!

@100
Copy link
Owner

100 commented Feb 5, 2017

Ok, fixed it in the main branch, thanks again for finding this

@100 100 closed this as completed Feb 5, 2017
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