keras-cam icon indicating copy to clipboard operation
keras-cam copied to clipboard

Error in Visualization Code

Open pGit1 opened this issue 8 years ago • 0 comments

See line 34: https://github.com/jacobgil/keras-cam/blob/master/cam.py

Shouldnt it be class_weights[1, :] instead of class_weights[:, 1]?

If this were a multiclass problem with 3 classes for instance my proposal would take the weight vector associated with that class. The way the code is now it would take the 2nd element in Class 0s weight vector, the 2nd element in Class 1's weight vector, and the 2nd element in Class 3's weight vector.

Am I missing something obvious? I looked at the class weight out put and confirmed that is what your current code is doing on line 34 which I cannot wrap my head around. I may be just confused about how CAM works.

pGit1 avatar Mar 10 '17 06:03 pGit1