Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Commit

Permalink
Update proximity
Browse files Browse the repository at this point in the history
  • Loading branch information
BirkhoffG committed Jun 13, 2023
1 parent 34adcd3 commit 174f2fa
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/benchmark_carla.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ def validity(factuals, counterfactuals, mlmodel):

def proximity(factuals, counterfactuals):
columns = counterfactuals.columns
return np.mean(
np.linalg.norm(factuals[columns].values - counterfactuals[columns].values,
axis=1, ord=1)
prox = np.linalg.norm(
factuals[columns].values - counterfactuals[columns].values,
axis=1, ord=1
)

prox = prox[~np.isnan(prox)]
return np.mean(prox)

def main():
os.environ["CUDA_VISIBLE_DEVICES"]=""
Expand Down

0 comments on commit 174f2fa

Please sign in to comment.