How to feed labels into classifier network
- Dominant language
- JavaScript
- Stars
- 11.2k
- Forks
- 2.1k
- PR merge metrics
- No merged PRs in 30d
Description
I am really enjoying learning convnet.js and have had some success with your regression models. Congrats to the developers.
However It is unclear how to provide labels for classification. I am using a very simple network (see below)
These are the layers and trainer and if you notice i have passed a 3 dimensional array (i am acually using 10 representing 0-9 digits)
But the trainer iterates as if the y value input is an integer and does a comparison i === y which can never be true in the backward method.
How do you pass 10 labeled binary outputs to the training function?
Also the output of the training function has a cost_loss and loss value which are the same but what does it mean? the loss value can range from a high of 2 or 4 to low of .03... so it is not a % accuracy number... what does it mean and how do i convert it to % accuracy?
Thanks
```
net.makeLayers( [ { type:'input' , out_sx:1, out_sy:1, out_depth:4}
, { type:'fc' , num_neurons:8, activation:'sigmoid' }
, { type: 'softmax' , num_classes: 3}])
trainer = new convnetjs.SGDTrainer(net, {learning_rate : 0.01, momentum: 0.0, batch_size: 1, l2_decay: 0.001});
for(var i=0;i< xtrain.length;i++) {
x.w[0] = (traindata[i][1]-66) / 40
x.w[1] = (traindata[i][2]-66) / 40
x.w[2] = (traindata[i][3]-66) / 40
x.w[3] = (traindata[i][4]-66) / 40
var stats = trainer.train(x, [ytrainz[i]/ 10, ytrainy[i]/ 10, ytrainx[i] /10])
```
Contributor guide
No contributing guide indexed for this repository
Research direction
The issue centers on the softmax configuration, the trainer.train call, and the backward method shown in the example. Read the classifier training path and loss reporting first, then document the accepted label representation and the meaning of cost_loss and loss. Done means a newcomer can prepare classification labels and interpret training results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- machine-learning
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100