Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step functions fixes, add in_context_pvi #223

Merged
merged 2 commits into from
Oct 23, 2023
Merged

Step functions fixes, add in_context_pvi #223

merged 2 commits into from
Oct 23, 2023

Conversation

gsarti
Copy link
Member

@gsarti gsarti commented Oct 22, 2023

Description

This PR:

  • Fixes the top-k and top-p filtering for the kl_divergence step function with a more general utility function
  • Adds pre-registered contrast_logit_fn and contrast_logit_diff_fn, equivalent to contrast_prob_fn and contrast_prob_diff_fn but using pre-softmax logits instead of probabilities.
  • Add the logprobs boolean parameter to probability_fn, contrast_prob_fn, contrast_prob_diff_fn and mc_dropout_prob_avg_fn to allow for using F.log_softmax log-probabilities instead of F.softmax probabilities (default behavior)
  • Add the in_context_pvi step function for calculating in-context pointwise V-usable information (Lu et al. 2023), using @boblus implementation from boblus/in-context-pvi

@gsarti gsarti merged commit fa9add1 into main Oct 23, 2023
4 checks passed
@gsarti gsarti deleted the in-context-pvi branch October 23, 2023 08:19
gsarti added a commit that referenced this pull request Oct 30, 2023
* origin/main:
  Attributed behavior for contrastive step functions (#228)
  Fix command for installing pre-commit hooks. (#229)
  Remove `max_input_length` from `model.encode` (#227)
  Migrate to `ruff format` (#225)
  Remove contrast_target_prefixes from contrastive step functions (#224)
  Step functions fixes, add `in_context_pvi` (#223)
  Format fixes, add Attanasio et al. (2023) to readme
  Add Sequential IG method (#222)
  Fix LIME and Occlusion outputs (#220)
  Update citation information
  Bump dependencies
  Add end_pos for contrast_targets_alignments
  Fix dummy output viz in console
  Minor fixes
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.

None yet

1 participant