Skip to content

Commit

Permalink
I_temp --> I
Browse files Browse the repository at this point in the history
  • Loading branch information
TomGeorge1234 committed Jan 25, 2024
1 parent 6c8f9c2 commit 85f2a37
Show file tree
Hide file tree
Showing 4 changed files with 116,781 additions and 436 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# RatInABox ![Tests](https://github.com/RatInABox-Lab/RatInABox/actions/workflows/test.yml/badge.svg) [![PyPI version](https://badge.fury.io/py/ratinabox.svg)](https://badge.fury.io/py/ratinabox) [![Downloads](https://static.pepy.tech/badge/ratinabox)](https://pepy.tech/project/ratinabox)<img align="right" src=".images/readme/logo.png" width=150>

`RatInABox` (see [paper](https://www.biorxiv.org/content/10.1101/2022.08.10.503541v3)) is a toolkit for generating synthetic behaviour and neural data for spatially and/or velocity selective cell types in complex continuous environments.
`RatInABox` (see [paper](https://www.biorxiv.org/content/10.1101/2022.08.10.503541v5)) is a toolkit for generating synthetic behaviour and neural data for spatially and/or velocity selective cell types in complex continuous environments.

[**Install**](#installing-and-importing) | [**Demos**](#get-started) | [**Features**](#feature-run-down) | [**Contributions and Questions**](#contribute) | [**Cite**](#cite)

Expand Down Expand Up @@ -124,9 +124,9 @@ Here are some easy to make examples.
#### **Complex `Environment`s: Polygons, curves, and holes**
By default, `Environments` in RatInABox are square (or rectangular if `aspect != 1`). It is possible to create arbitrary environment shapes using the `"boundary"` parameter at initialisation.

One can all add holes to the `Environment` using the `"holes"` parameter at initialisation. Positions sampled from the Environment (e.g. at initialisation) won't be inside holes.
You can also add holes to the `Environment` using the `"holes"` parameter at initialisation. When sampling positions from the Environment (e.g. at initialisation), holes won't be included.

Any curved environments can be made by creating a boundary of many small walls (uyse sparingly, walls may slow down computations)
Any curved environments can be made by creating a boundary of many small walls (use sparingly, walls may slow down computations, particular for wall-responsive representations, e.g. boundary vector cells.)

```python
#A trapezium shaped Environment
Expand All @@ -147,7 +147,6 @@ Env = Environment(params = {
})
```


<img src=".images/readme/complex_envs.png" width=1000>

#### **Objects**
Expand Down
117,203 changes: 116,774 additions & 429 deletions demos/paper_figures.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions ratinabox/Neurons.py
Original file line number Diff line number Diff line change
Expand Up @@ -2632,7 +2632,7 @@ def add_input(self, input_layer, w=None, w_init_scale=1, recurrent=False, **kwar
self.inputs[name]["layer"] = input_layer
self.inputs[name]["w"] = w
self.inputs[name]["w_init"] = w.copy()
self.inputs[name]["I"] = I
self.inputs[name]["I"] = I #stores the last input to this layer, only updated when "evaluate_at"=="last" i.e. not during plotting
self.inputs[name]["n"] = input_layer.n # a copy for convenience
self.inputs[name]["recurrent"] = recurrent
for key, value in kwargs.items():
Expand Down Expand Up @@ -2671,9 +2671,9 @@ def get_state(self, evaluate_at="last", max_recurrence=None, **kwargs):
w = inputlayer["w"]
if evaluate_at == "last":
I = inputlayer["layer"].firingrate
inputlayer["I"] = I
else: # kick can down the road let input layer decide how to evaluate the firingrate. this is core to feedforward layer as this recursive call will backprop through the upstraem layers until it reaches a "core" (e.g. place cells) layer which will then evaluate the firingrate.
I = inputlayer["layer"].get_state(evaluate_at, max_recurrence=pass_max_recurrence, **kwargs)
inputlayer["I_temp"] = I
V += np.matmul(w, I)

biases = self.biases
Expand Down
3 changes: 2 additions & 1 deletion ratinabox/contribs/ThetaSequenceAgent.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def update(self, dt=None, drift_velocity=None, drift_to_random_strength_ratio=1)
• Achilles and the tortoise: When behind the Agent we can interpolate along historic data but on each step the true agent moves forwards a little, so we must recollect this new data. The ThetaSequenceAgent position is Achilles, the TrueAgent is the tortoise.
• Interpolation expense: We must interpolate smoothly over historic data but this is expensive since it requires converting the list of past positions into an array then running scipy.interpolate.interp1d. So we want to take the least possible historic data which guarantees we'll have enough to do the behind sequence.
• Reference frame: In the current model the speed of the sequence is constant (in the reference frame of the TrueAgent) but the speed of the TrueAgent may not be. Therefore it is not enough to just interpolate over the past trajectory (indexed by time), we mmust transform coordinates to "distance travelled" (which is linear wrt the sequence).
• Reference frame: In the current model the speed of the sequence is constant (in the reference frame of the TrueAgent) but the speed of the TrueAgent may not be. Therefore it is not enough to just interpolate over the past trajectory (indexed by time), we must transform coordinates to "distance travelled" (which is linear wrt the sequence).
• Boundary conditions
"""

Expand Down Expand Up @@ -280,3 +280,4 @@ def plot_trajectory(self, sequences_ontop=False, **kwargs):
fig, ax = super(ThetaSequenceAgent, self).plot_trajectory(**kwargs_)

return fig, ax

0 comments on commit 85f2a37

Please sign in to comment.