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

Changed how firingrate is scaled to maximum for BVCs. #118

Merged
merged 1 commit into from
Nov 28, 2024

Conversation

colleenjg
Copy link
Contributor

To scale the firingrates of BVCs to between min_fr and max_fr, a maximum firingrate for each BVC must be computed during initialization.

The previous approach was to compute a within-environment estimate. However, particularly for FieldOfViewBVCs where head direction and position conjunctively determine firingrates, these values were sometimes being underestimated (see #110). Improving the estimates with more samples would be computationally demanding.

This PR proposes a new approach in which max firingrates are computed analytically as the maximum possible activity for each BVC (i.e., the firing rate for each BVC, if its receptive field is fully occupied by a boundary):

self.cell_fr_norm = utils.von_mises(
    theta=self.test_angles.reshape(1, -1),
    mu=0,
    sigma=self.sigma_angles.reshape(-1, 1),
    norm=1,
).sum(axis=1)

Notes for users:

  • Remaining noise: In most use cases, max_fr should now be more accurate. However, in a few cases (i.e., for BVCs with very small receptive fields), the maximum observed firing rate may still slightly overshoot the max_fr. This appears to be due to numerical error (see BVC firingrates go over max_fr #110 for details), and was mostly observed when using "uniform_manifold" cell arrangements.
  • Biggest change: Users may see a big change in BVC firing rates if their BVCs have very large or very distant receptive fields (i.e., BVCs that are unlikely to be maximally occupied in a given environment). The normalization factors for these cells will be much higher that if calculated empirically, and these cells may show much lower firing rates than before.

@colleenjg colleenjg force-pushed the cjg-dev branch 2 times, most recently from ba48a38 to a044049 Compare November 28, 2024 13:10
@TomGeorge1234
Copy link
Collaborator

perfect! love it. 10/10 :))

@TomGeorge1234 TomGeorge1234 reopened this Nov 28, 2024
@TomGeorge1234 TomGeorge1234 merged commit dc4c916 into RatInABox-Lab:main Nov 28, 2024
3 of 5 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.

2 participants