-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Access to built-in "uniform" function for PlaceCells / Agent velocity initialization #5
Comments
Thank you! And thank you for raising this issue.
|
Thank you for the explanation!
After updating the package, the 1D version raised an error.
It seems that it didn't detect the 1D environment? |
I'm happy for the change to be made. I agree it might be restrictive to enforce jitter on the place cell position. I leave it up to you if you want to PR it. Sorry, that's a trivial bug I knew about. I think I've fixed it now, please can you confirm if it is working. |
Yes, it works well now! Thanks for the quick update. |
Glad it's working! I'll close this issue. |
Hi there,
Thanks again for you contributions to RatInABox. I was wondering if I could ask you a favour.
I’m putting together a small talk to be given here at UCL and wanted to “showcase” the package being used in the broader science community. Would you have any simple figures, which demonstrate core RiaB functionality, I would be able to put in my slides crediting you of course.
Very much appreciate your help.
Tom
… On 27 Oct 2022, at 18:14, PikaPei ***@***.***> wrote:
Yes, it works well now! Thanks for the quick update.
I've also made a PR about place_cell_centres.
—
Reply to this email directly, view it on GitHub <#5 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AJ4G2JOCNWUNY4BIJEJ3MLTWFKZ7HANCNFSM6AAAAAARO2GBME>.
You are receiving this because you commented.
|
Hi George,
Thanks for the kind invitation.
I think I can't help because I just played this package and did
nothing more than your great demos.
Actually, I still try to figure out how to incorporate this package into my
project (also synaptic plasticity-related).
I may get some hints from another of your paper and repo (Rapid learning of
predictive maps with STDP and theta phase precession)!
By the way, after seeing this package, I'd like to generate some fake data
and do simple persistent homology analysis, like Fig. 2b in "The intrinsic
attractor manifold and population dynamics of a canonical cognitive circuit
across waking and sleep <https://doi.org/10.1038/s41593-019-0460-x>".
Basically, I would just let the agent run in the open field randomly and
record HeadDirectionCell or GridCell to see whether they form the ring or
torus structure.
(Although I am not really familiar with this field and not sure if it'll
work or not, just for fun 😅)
How do you feel about this? I may try it on the weekend. If you think it is
related to your topic, I can email you the result later!
Best regards,
Hsuan-Pei
Tom George ***@***.***> 於 2022年11月8日 週二 凌晨1:18寫道:
… Hi there,
Thanks again for you contributions to RatInABox. I was wondering if I
could ask you a favour.
I’m putting together a small talk to be given here at UCL and wanted to
“showcase” the package being used in the broader science community. Would
you have any simple figures, which demonstrate core RiaB functionality, I
would be able to put in my slides crediting you of course.
Very much appreciate your help.
Tom
> On 27 Oct 2022, at 18:14, PikaPei ***@***.***> wrote:
>
>
> Yes, it works well now! Thanks for the quick update.
> I've also made a PR about place_cell_centres.
>
> —
> Reply to this email directly, view it on GitHub <
#5 (comment)>,
or unsubscribe <
https://github.com/notifications/unsubscribe-auth/AJ4G2JOCNWUNY4BIJEJ3MLTWFKZ7HANCNFSM6AAAAAARO2GBME
>.
> You are receiving this because you commented.
>
—
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGJCWHYBQRE5SOBLKGY5S5TWHE2XBANCNFSM6AAAAAARO2GBME>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
This is a great idea. I would be happy to support you if you wanted to make an STDP layer of neurons and add it to RiaB. The best thing would be to build this off “FeedForwardlayer”. You may find some help looking at https://github.com/TomGeorge1234/STDP-SR/blob/main/mazeAgentUtils_reviewResponses.py this code for my other paper (line 508). It’s a bit of a mess but you will see how I sample spikes, update traces and use these to learn weights.
I think your idea about homology would definitely work and I’d love to see it! However for the torus you’d have to be careful to choose fixed grid frequencies (by default they are sampled randomly in RiaB). With fixed frequencies you should find a donut (I assume you are familiar with these two papers https://www.nature.com/articles/s41586-021-04268-7, https://reader.elsevier.com/reader/sd/pii/S0896627322009072?token=A7B5846F0A4A93EF4CB8BDE1AE407BBC155DF0C837099DD10972A5C912E6AC8F1FCD47CF8F55D1C9D72E48D18B5ABA25&originRegion=eu-west-1&originCreation=20221109113712)!
Good luck and let me know if you need help. If you do generate anything interesting I really would love to have a figure to put in my talk. Doesn’t need to be anything complex !
Tom
… On 9 Nov 2022, at 00:18, PikaPei ***@***.***> wrote:
Hi George,
Thanks for the kind invitation.
I think I can't help because I just played this package and did
nothing more than your great demos.
Actually, I still try to figure out how to incorporate this package into my
project (also synaptic plasticity-related).
I may get some hints from another of your paper and repo (Rapid learning of
predictive maps with STDP and theta phase precession)!
By the way, after seeing this package, I'd like to generate some fake data
and do simple persistent homology analysis, like Fig. 2b in "The intrinsic
attractor manifold and population dynamics of a canonical cognitive circuit
across waking and sleep <https://doi.org/10.1038/s41593-019-0460-x>".
Basically, I would just let the agent run in the open field randomly and
record HeadDirectionCell or GridCell to see whether they form the ring or
torus structure.
(Although I am not really familiar with this field and not sure if it'll
work or not, just for fun 😅)
How do you feel about this? I may try it on the weekend. If you think it is
related to your topic, I can email you the result later!
Best regards,
Hsuan-Pei
Tom George ***@***.***> 於 2022年11月8日 週二 凌晨1:18寫道:
> Hi there,
>
> Thanks again for you contributions to RatInABox. I was wondering if I
> could ask you a favour.
>
> I’m putting together a small talk to be given here at UCL and wanted to
> “showcase” the package being used in the broader science community. Would
> you have any simple figures, which demonstrate core RiaB functionality, I
> would be able to put in my slides crediting you of course.
>
> Very much appreciate your help.
>
> Tom
>
>
>
> > On 27 Oct 2022, at 18:14, PikaPei ***@***.***> wrote:
> >
> >
> > Yes, it works well now! Thanks for the quick update.
> > I've also made a PR about place_cell_centres.
> >
> > —
> > Reply to this email directly, view it on GitHub <
> #5 (comment)>,
> or unsubscribe <
> https://github.com/notifications/unsubscribe-auth/AJ4G2JOCNWUNY4BIJEJ3MLTWFKZ7HANCNFSM6AAAAAARO2GBME
> >.
> > You are receiving this because you commented.
> >
>
> —
> Reply to this email directly, view it on GitHub
> <#5 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AGJCWHYBQRE5SOBLKGY5S5TWHE2XBANCNFSM6AAAAAARO2GBME>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
—
Reply to this email directly, view it on GitHub <#5 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AJ4G2JJGTORKZJRRSP4FXITWHLUUFANCNFSM6AAAAAARO2GBME>.
You are receiving this because you modified the open/close state.
|
Hello George,
I'm sorry for the late reply.
(There was an emergency initially, but after a while, I felt embarrassed to
email back suddenly.)
Anyway, I have to thank you for giving me the entrypoint of your code.
Although the paper "the hippocampus as a predictive map" has been published
for several years. How to apply TD learning and STDP into this framework is
relatively new to me. It's fascinating, and I'll definitely take time to
see how you coded it!
In addition, thanks for providing the other two papers about the manifold
of the grid cells.
Recently, I try to use the firing rate output from HD cells or grid cells,
then do the homology analysis & dimension reduction for visualization.
If you don't mind, please allow me to share something I did with you!
* The HD part (upper in the figure) was using default setting (4 neurons),
and both the dimension reduction and Betti number showed the "ring
structure".
* However, I spent more time on the grid cell part (lower in the figure).
Although the Betti number seemed to show the "torus structure". I can't
find the torus shape in both dimension reduction method after 3d rotation
and view. But the figure in the paper is really pretty 😂!
I let all conditions become ideal, including `random_gridscales=False`,
`random_orientations=False`, and also organized phase_offsets.
I try different grid cell number or gridscale, but the results looked
similar. If there is any suggestions, it'll be great!
[image: image.png]
Last, when I modified the properties of grid cell, I did something to
RatInABox:
(1) added a line to avoid the error when `"random_gridscales": False`
(2) added a function to make organized phase_offsets
I'm not sure whether it should raise an issue or not, so I just mention it
here first.
Hope your talk is going well!
Hsuan-Pei
Tom George ***@***.***> 於 2022年11月9日 週三 晚上7:38寫道:
… This is a great idea. I would be happy to support you if you wanted to
make an STDP layer of neurons and add it to RiaB. The best thing would be
to build this off “FeedForwardlayer”. You may find some help looking at
https://github.com/TomGeorge1234/STDP-SR/blob/main/mazeAgentUtils_reviewResponses.py
this code for my other paper (line 508). It’s a bit of a mess but you will
see how I sample spikes, update traces and use these to learn weights.
I think your idea about homology would definitely work and I’d love to see
it! However for the torus you’d have to be careful to choose fixed grid
frequencies (by default they are sampled randomly in RiaB). With fixed
frequencies you should find a donut (I assume you are familiar with these
two papers https://www.nature.com/articles/s41586-021-04268-7,
https://reader.elsevier.com/reader/sd/pii/S0896627322009072?token=A7B5846F0A4A93EF4CB8BDE1AE407BBC155DF0C837099DD10972A5C912E6AC8F1FCD47CF8F55D1C9D72E48D18B5ABA25&originRegion=eu-west-1&originCreation=20221109113712)!
Good luck and let me know if you need help. If you do generate anything
interesting I really would love to have a figure to put in my talk. Doesn’t
need to be anything complex !
Tom
> On 9 Nov 2022, at 00:18, PikaPei ***@***.***> wrote:
>
>
> Hi George,
>
> Thanks for the kind invitation.
> I think I can't help because I just played this package and did
> nothing more than your great demos.
> Actually, I still try to figure out how to incorporate this package into
my
> project (also synaptic plasticity-related).
> I may get some hints from another of your paper and repo (Rapid learning
of
> predictive maps with STDP and theta phase precession)!
>
> By the way, after seeing this package, I'd like to generate some fake
data
> and do simple persistent homology analysis, like Fig. 2b in "The
intrinsic
> attractor manifold and population dynamics of a canonical cognitive
circuit
> across waking and sleep <https://doi.org/10.1038/s41593-019-0460-x>".
> Basically, I would just let the agent run in the open field randomly and
> record HeadDirectionCell or GridCell to see whether they form the ring or
> torus structure.
> (Although I am not really familiar with this field and not sure if it'll
> work or not, just for fun 😅)
>
> How do you feel about this? I may try it on the weekend. If you think it
is
> related to your topic, I can email you the result later!
>
> Best regards,
> Hsuan-Pei
>
>
> Tom George ***@***.***> 於 2022年11月8日 週二 凌晨1:18寫道:
>
> > Hi there,
> >
> > Thanks again for you contributions to RatInABox. I was wondering if I
> > could ask you a favour.
> >
> > I’m putting together a small talk to be given here at UCL and wanted to
> > “showcase” the package being used in the broader science community.
Would
> > you have any simple figures, which demonstrate core RiaB
functionality, I
> > would be able to put in my slides crediting you of course.
> >
> > Very much appreciate your help.
> >
> > Tom
> >
> >
> >
> > > On 27 Oct 2022, at 18:14, PikaPei ***@***.***> wrote:
> > >
> > >
> > > Yes, it works well now! Thanks for the quick update.
> > > I've also made a PR about place_cell_centres.
> > >
> > > —
> > > Reply to this email directly, view it on GitHub <
> >
#5 (comment)
>,
> > or unsubscribe <
> >
https://github.com/notifications/unsubscribe-auth/AJ4G2JOCNWUNY4BIJEJ3MLTWFKZ7HANCNFSM6AAAAAARO2GBME
> > >.
> > > You are receiving this because you commented.
> > >
> >
> > —
> > Reply to this email directly, view it on GitHub
> > <
#5 (comment)
>,
> > or unsubscribe
> > <
https://github.com/notifications/unsubscribe-auth/AGJCWHYBQRE5SOBLKGY5S5TWHE2XBANCNFSM6AAAAAARO2GBME
>
> > .
> > You are receiving this because you authored the thread.Message ID:
> > ***@***.***>
> >
> —
> Reply to this email directly, view it on GitHub <
#5 (comment)>,
or unsubscribe <
https://github.com/notifications/unsubscribe-auth/AJ4G2JJGTORKZJRRSP4FXITWHLUUFANCNFSM6AAAAAARO2GBME
>.
> You are receiving this because you modified the open/close state.
>
—
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGJCWHYYNNJGSPPLY6OK4DLWHOEMRANCNFSM6AAAAAARO2GBME>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hi Hsuan-Pei,
Great to hear from you, sorry about your emergency!
This is really cool analysis, I’m impressed and happy to hear that head cells and grids cells give ring and torus structure respectively. Unfortunately the image did not send, could you send it separately (then I will include it in my talk which I have not yet given).
I don’t have many ideas, here’s a couple
• What 3D dimensionality reduction method did they use in the paper? I suspect PCs won’t work as it’s linear but something non-linear might.
• I think you are correct in setting the gridscales and orientations not to be random (like real grids). I think the orientations and scales should all be identical and only the phase offsets change. How big are your grid scales, maybe worth making it smaller than the environment (ie ~0.4m).
• What are your boundary conditions, things may be harder if they are periodic as you need to consider how grid cells wrap around so maybe keep them solid for now.
• Do you have enough grid cells? I suspect O(100) would be roughly enough.
Please open a pull request for the grid scale bug. I’m happy for the phase offsets to be included if you think it’s simple and necessary, otherwise this is easy enough for users to implement themselves.
Best,
Tom
… On 29 Nov 2022, at 19:09, PikaPei ***@***.***> wrote:
Hsuan-Pei
|
Hi George,
Oh, I didn't notice the picture didn't be sent. Here is it!
Just for the record, the followings are some details:
- The settings of the environment and agent are default (the boundary is
solid).
- Some parameters for grid cells:
- num_grid_cells = 100
- gridscale = 0.45 (also tried 0.2 or 0.8)
- "random_gridscales": False
- "random_orientations": False
- The simulation ran 600s with dt = 0.01.
- Firing data used in dimension reduction: each 10 time step (i.e. 0.1s)
- Firing data used in homology analysis: each 100 time step (i.e. 1s)
PS. I open the issue to the wrong repo (so stupid...)
Thank you for these suggestions!
Hsuan-Pei
Tom George ***@***.***> 於 2022年11月30日 週三 清晨5:58寫道:
… Hi Hsuan-Pei,
Great to hear from you, sorry about your emergency!
This is really cool analysis, I’m impressed and happy to hear that head
cells and grids cells give ring and torus structure respectively.
Unfortunately the image did not send, could you send it separately (then I
will include it in my talk which I have not yet given).
I don’t have many ideas, here’s a couple
• What 3D dimensionality reduction method did they use in the paper? I
suspect PCs won’t work as it’s linear but something non-linear might.
• I think you are correct in setting the gridscales and orientations not
to be random (like real grids). I think the orientations and scales should
all be identical and only the phase offsets change. How big are your grid
scales, maybe worth making it smaller than the environment (ie ~0.4m).
• What are your boundary conditions, things may be harder if they are
periodic as you need to consider how grid cells wrap around so maybe keep
them solid for now.
• Do you have enough grid cells? I suspect O(100) would be roughly enough.
Please open a pull request for the grid scale bug. I’m happy for the phase
offsets to be included if you think it’s simple and necessary, otherwise
this is easy enough for users to implement themselves.
Best,
Tom
> On 29 Nov 2022, at 19:09, PikaPei ***@***.***> wrote:
>
> Hsuan-Pei
—
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGJCWH42SBIQ4TQL4BNXEH3WKZ36RANCNFSM6AAAAAARO2GBME>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Great work, it's simple and pretty!
I'm trying the 1D version. Here are some small questions/suggestions.
In the class
PlaceCells
,place_cell_centres
uses "uniform_jitter" method to sample the position.Although I can pass an array into place_cell_centres, I think it's easier to use the built-in "uniform" method?
When initializing Agent, if I didn't use the argument
params
but changedspeed_mean
directly, the initial velocity wouldn't be updated (it's still the default value).However, if using the
params
, it's correct. Not sure if this would be a problem or not.The text was updated successfully, but these errors were encountered: