RatInABox-Lab / RatInABox

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

Object vector cells #21

Closed TomGeorge1234 closed 1 year ago

TomGeorge1234 commented 1 year ago

I intend to add a new class of cells ObjectVectorCells. Each object vector cell reflects a tue of an object location, a prefered directional tuning and preferred angular tuning. The activity of the cell will be high when the agent is the preferred distance at the preferred angle away from the the object.

Each OVC will have an on-off parameter. This means they will be able to resemble, for example, LEDs which can be on or off.

TomGeorge1234 commented 1 year ago

ObjectVectorCells have now been added. Each OVC comes with a preferred direction and distance. This determines the firing field (gaussian in distance, von rises in direction). Example:

Env = Environment()
Ag = Agent(Env)
OVCs = ObjectVectorCells(Ag) 
fig, ax = OVCs.plot_rate_map()

OVCs_1848

By default, the position, tuning angles, tuning distances and the sharpness of these tunings are set at initialisation but they can be manually set be hand using the attributes:

self.object_locations #default random across environment
self.tuning_angles #default uniform from 0 to 2pi 
self.tuning_distances #default drawn from Rayleigh distribution around 25cm 
self.sigma_distances #linearly scales with the tuning distance
self.sigma_angles #default +-15 degrees 

ObjectVectorCells as visual cues

By setting, at time of initialisation, the input parameter field_of_view to True:

OVCs = ObjectVectorCells(Ag,params = {'field_of_view':True})

then, the behaviour of the cells is such that they will only fire if the Agents head direction is pointed towards them. This works because the 'angle' is calculated as the difference between the heading direction of the Agent and the direction of the vector between it and the OVCs. The preference angles are set to zero, the the cells select for when the heading direction = the vector bearing. In this "egocentric" mode they act like, perhaps, LEDs-detector-neurons, which only fire when being looked.