Generalise HeadDirectionCells to N directions
TomGeorge1234 opened this issue · 1 comments
Currently there are always exactly 4 HDCs encoding the N,E,S,W components of the velocity. It would be better to generalise this to N arbitrary or evenly space directions, perhaps also there could be a angular_spread parameter determining their specificity.
Head direction cells have now been generalised. By default n
head direction cells will have direction selectivity preferences of n
directions evenly spaced on the unit circle (starting at zero degrees, i.e. along the x-axis, [1,0]). Set these manually with HDCs.preferred_angles
.
A new parameter "angular_spread_degrees"
determines the width of the selectivity function (default 30 degrees) which is von Mises centred at the direction selectivity angle.
Example:
from ratinabox.Neurons import HeadDirectionCells
Env = Environment()
Ag = Agent(Env)
HDCs = HeadDirectionCells(Ag,params={"n":10,"angular_spread_degrees":30})
while Ag.t < 30:
Ag.update()
HDCs.update()
fig, ax = plt.subplots(1,2,figsize=(5,2))
Ag.plot_trajectory(fig=fig,ax=ax[0])
HDCs.plot_rate_timeseries(fig=fig,ax=ax[1])
Additionally, VelocityCells
have been updated so they are now just a scaled subclass of HeadDirectionCells.
Currently this change is enacted on dev
branch and will will pushed to 1.x
or published soon.