RatInABox-Lab / RatInABox

A python package for simulating 2D motion in continuous environment and spatial cell types (e.g. place cell).
MIT License
184 stars 31 forks source link

Fixed incorrect scaling of BVCs firingrates I#108. #109

Closed colleenjg closed 6 months ago

colleenjg commented 6 months ago

Fixes #108.

Added a line when self.cell_fr_norm is initialized in the BVCs to unscale it using self.min_fr and self.max_fr.

BVCs now generate firingrates spanning the full range expected with min_fr and max_fr.

Note: The small overshoot above max_fr mentioned in the issue is not addressed here.

TomGeorge1234 commented 6 months ago

Nice, thank you! Can I just double check...does this work if the min_fr != 0 (i.e if the scaling isn't just multiplicative).

colleenjg commented 6 months ago

Yes! I tested it on a variety of combinations, and they all come out correctly (unless the user incorrectly sets min_fr > max_fr, which explodes the values with or without the PR change).

MIN_FR = 8; MAX_FR = 10 => 8.0000 to 10.0175 MIN_FR = 0.1; MAX_FR = 125 => 0.1 to 126.0953

TomGeorge1234 commented 6 months ago

looks good, just merged! 🙏🏼