neurosim / DNN_NeuroSim_V1.3

Benchmark framework of compute-in-memory based accelerators for deep neural network (inference engine focused)
62 stars 36 forks source link

accuracy larger than 100% #31

Closed DavidSe7enLynch closed 2 years ago

DavidSe7enLynch commented 2 years ago

When testing VGG8, the accuracy output is 1805%.

I added a line in inference.py to manually accumulate the number of data compared:

correct += pred.cpu().eq(indx_target).sum() # this line already exists total_pred += len(pred) # new added line

And I tried to calculate accuracy by correct/total_pred. In this way, the result is about 91%, which seems reasonable. Is this way of calculating correct?

neurosim commented 2 years ago

I don't have the problem... But your way also looks correct.