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

Is Error similarity score equal to TracIN score in colab notebooks? #6

Closed
VenkateshSatagopan opened this issue Apr 12, 2021 · 2 comments

Comments

@VenkateshSatagopan
Copy link

VenkateshSatagopan commented Apr 12, 2021

Hi Frederick,
Thanks for your colab notebook implementation. I am trying to understand the calculation of TracIN score in the notebook "resnet50_imagenet_proponents_opponents" where you calculate 3 scores in the loss function as shown below

def find(loss_grad=None, activation=None, topk=50):
        if loss_grad is None and activation is None:
              raise ValueError('loss grad and activation cannot both be None.')
        scores = []
        scores_lg = []
        scores_a = []
        for i in range(len(trackin_train['image_ids'])):
             if loss_grad is not None and activation is not None:
                     lg_sim = np.sum(trackin_train['loss_grads'][i] * loss_grad)
                     a_sim = np.sum(trackin_train['activations'][i] * activation)
                     scores.append(lg_sim * a_sim)
                     scores_lg.append(lg_sim)
                     scores_a.append(a_sim)

Here you calculate lg_sim, a_sim, and scores and mention them as error_similarity, encoding similarity and influence when you display proponents and opponents for a particular test image.
lg_sim calculation is similar to the formula for calculating TracIN mentioned in the paper. so is the lg_sim score is equivalent to TracIN scores for differentiating proponents and opponents? Is my understanding correct? If so what are the significance of a_sim and scores parameters?

Thanks in Advance

@frederick0329
Copy link
Owner

Thank you for the question.

Please refer to appendix F of the paper.
influence(tracin score) = lg_sim (error_similarity) * a_sim (encoding similarity)

@VenkateshSatagopan
Copy link
Author

Thanks frederick,
I got it now about the influence score calculation.

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

No branches or pull requests

2 participants