AllenInstitute / bmtk

Brain Modeling Toolkit
https://alleninstitute.github.io/bmtk/
BSD 3-Clause "New" or "Revised" License
265 stars 86 forks source link

Fixing FilterNet behavior for frame_rate != 1000.0 #375

Closed shixnya closed 2 days ago

shixnya commented 2 months ago

Fixing FilterNet's behavior when the frame_rate is not 1000 Hz.

Previously, firing rates were not normalized correctly and were proportional to the frame_rate. This behavior is now fixed. You can expect the same firing rate outcome with different frame_rate, up to the filter accuracy.

Note: The frequency of the filter's temporal kernel should define the frame_rate. For our LGN models, the peaks are as narrow as several milliseconds, so 1000 Hz frame rate is a reasonable default.

The corresponding tests were also fixed. The neurons with multiple receptive fields can come with firing rate offset for their transfer function. I think these won't work in the previous implementation (another reason that we were locked into 1000 Hz). Although this required updating the values in the unit test results, I think the new ones are correct.

Kael, I tend to leave verbose comments in the code to give some context. If you feel they are unnecessary, please feel free to delete them.