torch / demos

Demos and tutorials around Torch7.
355 stars 301 forks source link

Wrongly reporting mean class accuracy #7

Open Nanne opened 10 years ago

Nanne commented 10 years ago

In the CNN demo's (cifar, housenumbers, and digit-classifier) the performance is reported in the form of the mean class accuracy. However this is done using confusion.totalValid, which is the total accuracy, not the mean class accuracy. The mean class accuracy can be found in confusion.averageValid.

totalValid is the sum of the diagonal of the confusion matrix divided by the sum of the matrix. averageValid is the average of all diagonals divided by their respective rows.

Is the intention to report the accuracy and is the text wrong or is the wrong variable used? My guess would be the latter.

clementfarabet commented 10 years ago

That's a bug, the mean class accuracy is definitely in averageValid...

waldoweng commented 6 years ago

and the code also need to call confusion:updateValids() before using confusion.totalValid