Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-added-large-files
- id: check-builtin-literals
Expand All @@ -12,7 +12,7 @@ repos:
- id: end-of-file-fixer
- id: mixed-line-ending
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.3
rev: v0.16.8
hooks:
- id: ruff
args:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ model = ...
imputer = sage.MarginalImputer(model, x[:128])

# Set up an estimator
estimator = sage.PermutationEstimator(imputer, 'mse')
estimator = sage.PermutationEstimator(imputer, "mse")

# Calculate SAGE values
sage_values = estimator(x, y)
Expand Down
2 changes: 1 addition & 1 deletion sage/kernel_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from sage import core, utils


def calculate_A(num_features): # noqa:N802
def calculate_A(num_features): # ruff: ignore[invalid-function-name]
"""Calculate A parameter's exact form."""
p_coaccur = (
np.sum(
Expand Down
4 changes: 2 additions & 2 deletions sage/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def model_conversion(model):

model.eval()
device = next(model.parameters()).device
return (
lambda x: model(torch.tensor(x, dtype=torch.float32, device=device))
return lambda x: (
model(torch.tensor(x, dtype=torch.float32, device=device))
.cpu()
.data.numpy()
)
Expand Down
Loading