Skip to content

Commit

Permalink
Patch-fix new step scores arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
gsarti committed May 30, 2023
1 parent 458f81d commit b5d3610
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions inseq/attr/step_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ def pcxmi_fn(
attribution_model=attribution_model,
contrast_sources=contrast_sources,
contrast_target_prefixes=contrast_target_prefixes,
target_ids=target_ids,
**kwargs,
)
return -torch.log2(torch.div(original_probs, contrast_probs))
Expand All @@ -260,6 +261,7 @@ def pcxmi_fn(
def kl_divergence_fn(
attribution_model: "AttributionModel",
forward_output: ModelOutput,
target_ids: TargetIdsTensor,
contrast_sources: Optional[FeatureAttributionInput] = None,
contrast_target_prefixes: Optional[FeatureAttributionInput] = None,
top_k: int = 0,
Expand Down

0 comments on commit b5d3610

Please sign in to comment.