Skip to content

Conversation

@haochend413
Copy link
Contributor

@haochend413 haochend413 commented Dec 31, 2025

Description

Add random projection for some IF attributors

  • IF_Explicit
  • IF_EKFAC
  • IF_DataInf

Closes #227

@haochend413
Copy link
Contributor Author

haochend413 commented Jan 1, 2026

I ran the IF attributors on the influence_functions_lds example after adding random projection.

Explicit on mnist_lr: ? -> 0.4851
EKFAC on mnist_mlp: 0.1151 -> 0.1140
DataInf on mnist_lr: 0.3173->0.2978

@sleepymalc sleepymalc self-requested a review January 9, 2026 08:18
Returns:
torch.Tensor: Transformed train representations with projected dimension.
"""
from dattri.func.projection import random_project
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@TonyZhou05
Copy link

Could we check the attribute function call to make sure that the projection has some effect on larger models such as mobilenet_v2? Currently calculating the influence score on any IF attributor is really slow (No progress on A100 GPU for mobilenet_v2 in 10 minutes) I can create this as a separate bug if needed.

Code snippets

train_subset = Subset(full_train_noisy, range(0, 5000))
train_loader = DataLoader(train_subset, batch_size=32, shuffle=False)
val_loader = DataLoader(val_subset, batch_size=32, shuffle=False)
with torch.no_grad():
    # This steps won't finish
    influence_scores = if_attributor.attribute(train_loader, val_loader)

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 this pull request may close these issues.

Influence Function with Projection

3 participants