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

add_agc_plus_receptor_potential #21

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

JasonMH17
Copy link
Contributor

Updated carfac.py + test + utils/tests + bench + float64_test to include receptor potential + agc_memory as outputs

@JasonMH17
Copy link
Contributor Author

@robsc looks a little better...hope its suitable for review!!

@@ -2483,10 +2493,12 @@ def run_segment_jit(
naps: neural activity pattern
naps_fibers: neural activity of the different fiber types
(only populated with non-zeros when ihc_style equals "two_cap_with_syn")
receptor_pot: receptor potential of ihc
state: the updated state of the CARFAC model.
BM: The basilar membrane motion
seg_ohc & seg_agc are optional extra outputs useful for seeing what the
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not your change: but lets split this comment to really have one per arg.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks Rob, do you mean the seg_ohc + seg_agc?

naps = jnp.zeros((n_samp, n_ch, n_ears)) # allocate space for result
naps_fibers = jnp.zeros((n_samp, n_ch, n_fibertypes, n_ears))
receptor_pot = jnp.zeros((n_samp, n_ch, n_ears))
Copy link
Collaborator

Choose a reason for hiding this comment

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

for the receptor pot, is it more of an optional item, a la agc and agc_memory?

if so, name as such and place at end of outputs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup its technically optional and more for debugging + further changes...will move it around

@@ -179,7 +179,7 @@ def loss_func(
weights: carfac_jax.CarfacWeights,
state: carfac_jax.CarfacState,
):
nap_output, _, _, _, _, _ = carfac_jax.run_segment(
nap_output, naps_fibers_output, _, _, _, _ = carfac_jax.run_segment(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why add this as a named output (here and below)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not necessary at all...probably left over from testing!!

Made changes as requested + altered other calls to run_segment/run_segment_jit that accompany changes to carfac.py
receptor_pot (ihc receptor potential in two_cap model) is now an optional extra and positioned accordingly.  Also separated + clarified origins of seg_ohc + seg_agc
 carfac_float64_test + carfac_util  to match changes to run_segment in carfac.py
No matches carfac.py changes to receptor_pot
@JasonMH17
Copy link
Contributor Author

@robsc Hope these changes are suitable...I have another question...I use a for loop to assign agc_memory to the final output...do you think this be performed by concatenating agc_memory across state.ears[ear].agc[:].agc_memory and then assigning?

@dicklyon
Copy link
Collaborator

dicklyon commented Dec 31, 2024 via email

@dicklyon
Copy link
Collaborator

dicklyon commented Jan 1, 2025 via email

agc_memory_out has been removed and replaced with agc_out. agc_out now equals the stage 1 and final agc output
@JasonMH17
Copy link
Contributor Author

@robsc @dicklyon agc_out now points to stage 1/final agc output

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.

3 participants