Skip to content

Conversation

wulfdewolf
Copy link
Collaborator

This implements decode_template, as a counterpart to decode_bayes.
The template matching algorithm considers the tuning curves as population vector templates for every feature bin.
To decode, we compute the distance to all feature bin population vectors, normalize between 0 and 1 to get a distribution, and we return the highest one as the decoded bin.

@wulfdewolf wulfdewolf self-assigned this Jul 23, 2025
@wulfdewolf wulfdewolf linked an issue Jul 23, 2025 that may be closed by this pull request
Copy link

codecov bot commented Jul 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
pynapple/process/__init__.py 100.00% <100.00%> (ø)
pynapple/process/decoding.py 90.42% <100.00%> (+4.48%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@wulfdewolf wulfdewolf changed the base branch from dev to main August 1, 2025 16:29
@wulfdewolf wulfdewolf changed the base branch from main to dev August 1, 2025 16:29
@wulfdewolf wulfdewolf marked this pull request as ready for review August 5, 2025 16:23
@wulfdewolf wulfdewolf requested a review from gviejo as a code owner August 5, 2025 16:23
@wulfdewolf wulfdewolf requested a review from sjvenditto August 5, 2025 16:23
Copy link
Collaborator

@sjvenditto sjvenditto left a comment

Choose a reason for hiding this comment

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

Everything is looking great! I've left a few suggestions on the docstring and incorporating a prior

@wulfdewolf wulfdewolf requested a review from sjvenditto August 7, 2025 20:05
Copy link
Collaborator

@sjvenditto sjvenditto left a comment

Choose a reason for hiding this comment

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

I have a few last docs and grammar suggestions. Also, do you think we should rename the calcium imaging tutorial? Right now it's "Computing calcium imaging tuning curves". We could make it more broad like "Analyzing calcium imaging data", similar to the head direction one

@wulfdewolf wulfdewolf requested a review from sjvenditto August 14, 2025 15:46
@gviejo gviejo merged commit 089d2c9 into dev Aug 20, 2025
16 checks passed
@gviejo gviejo deleted the 476-template-matching branch August 20, 2025 18:31
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.

Add template matching decoding

3 participants