RatInABox-Lab / RatInABox

A python package for modelling locomotion in complex environments and spatially/velocity selective cell activity.
MIT License
172 stars 31 forks source link

Head direction flexibility #70

Closed TomGeorge1234 closed 12 months ago

TomGeorge1234 commented 12 months ago

Egocentric representations (e.g. HeadDirectionCells and egocentric BoundaryVectorCells) require the agents head direction to calculate their firing rates. Currently the head direction of the Agent is assumed to just be the normalised velocity. This is a little restrictive. It would be better if there was a separate variable which could, in theory, be independent from velocity. Here's what I propose:

A new variable Agent.head_direction : np.ndarray(shape=(2,). By default Agent.head_direction is updated to be equal to the (normalised) Agent.velocity at each time step. However, if a new input parameter ("head_direction_smoothing_timescale" defaulting to zero) is non-zero then the head direction can be equal to the velocity vector smoothed by an exponential kernel. This should allowhead_direction` to be less noisy even if the velocity vector is noisy.

In the future users could generalise this further and even have entirely independent dynamics for the head direction vector.

TomGeorge1234 commented 12 months ago

To clarify for @mehulrastogi:

Thanks! Let me know if you run into any troubles