Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why large influence is harmful #11

Open
zwxu064 opened this issue May 8, 2020 · 4 comments · May be fixed by #32
Open

why large influence is harmful #11

zwxu064 opened this issue May 8, 2020 · 4 comments · May be fixed by #32

Comments

@zwxu064
Copy link

zwxu064 commented May 8, 2020

does there have any evaluation for influence function values? I found the most helpful train image label in CIFAR10 is 2 while the test image label 4.

@nimarb
Copy link
Owner

nimarb commented May 10, 2020

There is no absolute guidance on what influence numbers are harmful / helpful to the model to make a single prediction. Rather, those are in relation to one another meaning you're able to rank them.

@QingXuTHU
Copy link

QingXuTHU commented Jul 14, 2020

I have the same question. I'm not sure whether in implementation you calculate I_{up,loss} or -1/n I_{up,loss} in original paper. And I use it in MINIST and find out that the avg contribution is very negative if the chosen train set and test set have the same number. I'm not sure whether something wrong occurs in my experiments. But hope you can check this part..

@chengrunyang
Copy link

chengrunyang commented Dec 28, 2020

I have the same doubts as @QingXuTHU . It seems from

that the implementation is calculating 1/n * I_{up, loss} (z, z_test), and then take the largest as helpful and smallest as harmful. However, I think it should be the opposite: the points with negative I_{up, loss} (z, z_test) should be helpful, and those positive I_{up, loss} (z, z_test) should be harmful (refer to the title of Page 3, Figure 1 of the Koh and Liang paper). I wonder if someone could help check it, thanks!

@lange-martin
Copy link

the points with negative I_{up, loss} (z, z_test) should be helpful, and those positive I_{up, loss} (z, z_test) should be harmful (refer to the title of Page 3, Figure 1 of the Koh and Liang paper)

I agree @chengrunyang. On page 6 of the paper, the authors also clarify that the most helpful images are those with the "most positive -I_{up, loss}" (or equivalently the most negative I_{up, loss}). Since np.argsort sorts the indices in ascending order, the harmful and helpful arrays should be switched in this code snippet:

harmful = np.argsort(influences)
helpful = harmful[::-1]

I stumbled upon this issue while testing how often a training sample is its own most influential sample. Most of the time, the training sample came out as its own most harmful sample, which is counter-intuitive. This bug in the code explains that behavior.

@lange-martin lange-martin linked a pull request Mar 24, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants