Ratinabox

Latest version: v1.15.1

Safety actively analyzes 682416 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 6

1.11.4

1D Objects (thanks colleenjg) and minor bug fix for place cell distributions relating to 96

1.11.3

Updates to the website including new pages for demos and testimonials and a rescaled logo

1.11.2

Recurrent inputs for `FeedForwardLayer`

Previously `FeedForwardLayers` would throw recursion errors when you plot their rate maps if any of the inputs were recurrent (or ultimately part of a recurrent loop) since the `get_state()` method would call the input layer, which would call the input layer, which would.... you get the idea.


This has been elegantly fixed by colleenjg. Flag an I put as recurrent when you add it and at rate map evaluation time specificy the recursion depth you want to go to.


Before

Env = Environment()
Ag = Agent(Env)
PCs = PlaceCells(Ag)
FFL = FeedForwardLayer(Ag)

FFL.add_input(PCs)
FFL.add_input(FFL) < a recurrent input!!!

FFL.plot_rate_map()

returns

RecursionError: maximum recursion depth exceeded in comparison



Now

Env = Environment()
Ag = Agent(Env)
PCs = PlaceCells(Ag)
FFL = FeedForwardLayer(Ag)

FFL.add_input(PCs)
FFL.add_input(FFL,recurrent=True) < a recurrent input, flag it as such!!!

FFL.plot_rate_map(max_recurrence=0) max number of times to pass through the recurrent input loop before then ignoring it
FFL.plot_rate_map(max_recurrence=1) 1 pass through the loop
FFL.plot_rate_map(max_recurrence=100) 100 passes

![3c783622-00fc-45df-95ae-0dc7e670a881](https://github.com/RatInABox-Lab/RatInABox/assets/41446693/13a4f343-9c08-43a0-9af5-52d60c387f88)
![de109171-be11-4b06-8828-e1f54d9af97c](https://github.com/RatInABox-Lab/RatInABox/assets/41446693/be86612e-f390-47b7-a215-fbb63e9d4593)
![3c483aba-bc6f-4728-ab7d-8b34833bdf5b](https://github.com/RatInABox-Lab/RatInABox/assets/41446693/5fe4fe38-887e-429d-9af2-40da427d5b6e)

1.11.2a

No change to code. Just a bug fix for website https://ratinabox-lab.github.io/RatInABox/

1.11.1

New plotting functions and demo focussing on head direction

Head direction selectivity can be plotted for _all_ cells.
python
Env = Environment()
Ag = Agent(Env)
HDCs = HeadDirectionCells(Ag, params={'n':3,'color':'C5'}) or any other
HDCs.plot_angular_rate_map()

![02b39dc7-d287-4349-88ad-e54594014973](https://github.com/RatInABox-Lab/RatInABox/assets/41446693/fabbfd7f-8f23-4041-b5e1-c55d3d66e744)


Spatial rate maps can be plotted _averaged_ over all head directions (for use in instances where rate maps may be position and head direction selective).
This is supported by a new internal function `get_head_direction_averaged_state()` which calculates the state at all head direction 0 --> 2pi and then averages over these return the spatial receptive field.

python
Env = Environment()
Ag = Agent(Env)
GCs = GridCells(Ag, params={'n':3}) or any other.
GCs.plot_rate_map(method="groundtruth_headdirectionaveraged")

(in this case its actually redundant because grid cells have no head direction selectivity but in [this demo](https://github.com/RatInABox-Lab/RatInABox/blob/dev/demos/conjunctive_gridcells_example.ipynb) we show a more involved use case
![79d31cdb-92e7-4083-bc27-5de3a24eff12](https://github.com/RatInABox-Lab/RatInABox/assets/41446693/fea29743-9a52-47b4-ae32-f44041c9ed19)

New Conjunctive grid cells demo
In this demo we showcase `FeedForwardLayer` in probably its most simple use-case. Combining head direction cells and grid cells non-linearly to make head direction selective grid cells (conjunctive grid cells)
![conjunctive_grid_cells](https://github.com/RatInABox-Lab/RatInABox/assets/41446693/f860fbdd-636b-4114-81ca-9986909cf7b4)

1.11.0

`AgentVectorCells` and `FieldOfViewAVCs`

`AgentVectorCells` are like `ObjectVectorCells` but respond to other `Agent`s in the `Environment`.
`FieldOfViewAVCs` are a subclass of AVCs arranged in a "field of view" as shown in the attached video. A demo can be found [here](https://github.com/RatInABox-Lab/RatInABox/blob/dev/demos/vector_cell_demo.ipynb) (scroll to the bottom). This relates to #89 and closes 91.

https://github.com/RatInABox-Lab/RatInABox/assets/41446693/300baddc-24ca-4495-aae6-916b3bf0a8a6


python
from ratinabox.Neurons import AgentVectorCells, FieldOfViewAVCs

Env = Environment()
Ag1 = Agent(Env)
Ag2 = Agent(Env)
AVCs_1to2 = FieldOfViewAVCs(Ag1, Other_Agent=Ag2)
AVCs_2to1 = FieldOfViewAVCs(Ag2, Other_Agent=Ag1)

remember to update both agents and neurons in the update loop:
for _ in range(int(20/Ag1.dt)):
Ag1.update()
Ag2.update()
AVCs_1to2.update()
AVCs_2to1.update()


Other minor changes
* Changes to `VectorCells` and `GridCell` API for how parameters are initialised/sampled (should be backward compatible, a warning might be thrown if you use old parameter names).
* Bug fixes
* New DNN demo

Page 3 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.