Skip to content

Added softmax likelihood for choice-only models#909

Merged
digicosmos86 merged 3 commits into906-update-config-for-choice-only-modelsfrom
908-implement-a-general-softmax-likelihood
Mar 5, 2026
Merged

Added softmax likelihood for choice-only models#909
digicosmos86 merged 3 commits into906-update-config-for-choice-only-modelsfrom
908-implement-a-general-softmax-likelihood

Conversation

@digicosmos86
Copy link
Collaborator

Note: the test only tests that the output shape is correct (a 1-d array of length n where n is the length of data)

Copy link
Member

@AlexanderFengler AlexanderFengler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small comments, both concerned with consistency.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a softmax inverse temperature likelihood function for choice-only models, allowing the framework to model scenarios where only choices (not reaction times) are observed. The function computes log-likelihood for choice data using a softmax transformation with an inverse temperature parameter.

Changes:

  • Added softmax_inv_temperature function to compute choice-only likelihood with variable number of logits
  • Updated type annotations from typing.Type to type (Python 3.9+ syntax)
  • Added basic shape validation tests for 2-choice and 3-choice scenarios

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 9 comments.

File Description
src/hssm/likelihoods/analytical.py Added softmax_inv_temperature function and modernized type annotations from Type[T] to type[T]
tests/test_likelihoods_choice_only.py Added parametrized shape validation tests for binary and ternary choice scenarios

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

digicosmos86 and others added 2 commits February 25, 2026 19:55
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Collaborator

@cpaniaguam cpaniaguam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Collaborator

@krishnbera krishnbera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Member

@AlexanderFengler AlexanderFengler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one is good to go. Thanks @digicosmos86

@digicosmos86 digicosmos86 merged commit 378b02c into 906-update-config-for-choice-only-models Mar 5, 2026
4 checks passed
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.

Implement a general softmax_inv_temperature function for arbitrary numbers of parameters

5 participants