Coder Social home page Coder Social logo

mertyg / debug-mistakes-cce Goto Github PK

View Code? Open in Web Editor NEW
71.0 8.0 6.0 44.93 MB

Meaningfully debugging model mistakes with conceptual counterfactual explanations. ICML 2022

License: MIT License

Python 96.67% Shell 3.33%
concepts counterfactual-explanations explanations interpretability

debug-mistakes-cce's People

Contributors

conceptualcounterfactuals avatar mertyg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

debug-mistakes-cce's Issues

computing W_clamp_min

Hello,
I'm a PhD student working on XAI. And I came across your paper so I decided to test the provided implementation, which I thank you for. The code is very clear and easy to understand !

While studying the code, I noticed the following:
In cce_utils.py, line 68, shouldn't W_clamp_min be computed as

  • (W_clamp_min / (min_margins * concept_norms)).T
  • instead of (W_clamp_min / (max_margins * concept_norms)).T ?

I'm saying this based on equation (6) provided in section 3.2 of your paper. Please correct me if I'm wrong or if I misunderstood something.

Thank you in advance!

Code release

Excellent work! Can I know when you will release the code?

[Bug] MetashiftManager loads wrong images

First of all, thank you for your work.

I am re-implementing your codes for spurious detection experiments.

By the way, I found that the wrong evaluation images are used.

Load image list

from dataset import MetashiftManager

dataset_name = "bear-bird-cat-dog-elephant:dog(snow)"
manager = MetashiftManager()
classes, train_domain = dataset_name.split(":")
classes = classes.split("-")
num_classes = len(classes)
shift_class = train_domain.split("(")[0]
spurious_concept = train_domain.split("(")[1][:-1].lower()
print(f"Shift Class: {shift_class}, Spurious Concept: {spurious_concept}")

Result:

Shift Class: dog, Spurious Concept: snow

Get image list for all classes

class_images = manager.get_class_ims(classes)
len(class_images["dog"])

Result:

2580

Check images in "dog" class

from PIL import Image
Image.open(class_images["dog"][2077])

image

from PIL import Image
Image.open(class_images["dog"][1616])

image

For classification, there is no "dog" in an image cropped from this image.

Many images in class "dog" are unrelated to class "dog".

Please let me know the reason.

Is your experiment wrong?

I found that the wrong images contain hotdogs...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.