Skip to content

Commit

Permalink
Explain: improve docstring about IntegratedGradient baseline for numb…
Browse files Browse the repository at this point in the history
…er features (#3018)
  • Loading branch information
jppgks authored Jan 30, 2023
1 parent b975dd5 commit f687b6e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ludwig/explain/captum.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,7 @@ def get_baseline(model: LudwigModel, sample_encoded: List[Variable]) -> List[tor
elif feature.type() == IMAGE:
baseline = torch.zeros_like(sample_input[0], device=DEVICE)
else:
# For a robust baseline, we take the mean of all embeddings in the sample from the training data.
# TODO(joppe): now that we don't have embeddings, we should re-evaluate this.
# For a robust baseline, we take the mean of all samples from the training data.
baseline = torch.mean(sample_input.float(), dim=0)
baselines.append(baseline.unsqueeze(0))

Expand Down

0 comments on commit f687b6e

Please sign in to comment.