The model and task.

a) Overview of the decoding approach: Given a simulated trajectory with coordinates x, the output states of the network are decoded in terms of their spatial center locations µ, which in turn are used to decode an estimate of the current location. The network is trained to minimize the squared difference between true and decoded positions. b) Illustration of the proposed decoding procedure. For a single unit, the center location is estimated as the average location, weighted by the unit activity along a trajectory. By iterating this procedure, every unit can be assigned a center location. A location can then be estimated as the average center location, weighted by the activity of the corresponding unit at a particular time. Repeating this for every timestep, full trajectories can be reconstructed. c) The investigated geometries, each with an example simulated trajectory. Each environment is labelled by its context signal (one-hot vector). d) Illustration of the network architecture and inputs. g features recurrently connected units, while p receives densely connected feedforward input from g. When moved between environments, the state of the RNN is maintained (gprev). The input v denotes Cartesian velocities along simulated trajectories, while c is a constant (in time and space) context signal.

Trained network performance and representations.

a) Euclidean distance (error) between target and reconstructed trajectories over training time. Shown is the error for both training and validation datasets. b) A slice (timesteps 250 to 400) of a decoded trajectory (dashed, red) and the corresponding target trajectory (black). c) Ratemaps for the 16 output units with the largest mean activity, in the square environment. d) Same as c), but for recurrent units.

Comparing representations across environments.

a) Top: The network is run in a familiar square environment (A), transferred to the square with a central wall (B) and revisits the original square (A’). The network state persists between environments, and starting locations are randomly sampled. Bottom: i) Ratemaps for a subset of recurrent units (g) with largest minimum mean rate across arenas. Rows represent unit activity, with max rate inset on the right. ii) Same as i), for output units. b) Distribution of spatial correlations comparing ratemaps from active units across similar contexts (A, A’) and distinct contexts (A, B). Shuffled distributions are formed by randomly pairing units across contexts. The dashed red line indicates the 95th percentile of the shuffled distribution. c) Distribution of rate overlaps for all units with non-zero activity in any environment. d) Distribution of rate differences. e) Ratemap population vector correlations for units with nonzero activity at every timestep for transitions (timestep 500) from A to B.

Effects of geometric manipulations on learned representations while maintaining the original context signal.

a) Ratemaps of 9 recurrent (g) and output units (p) during horizontal elongation of a familiar square context. The top inset indicates the geometry and context signal (A), as well as manipulation of the environment (horizontal stretch by factors of 2 and 3). b) Similar to a), but the geometric manipulation consists of filling in the central hole of the familiar context (square with central hole, context B). c) Similar to a), but for joint horizontal and vertical elongation. d) Similar to c), but for uniform expansion of a familiar circular environment (C).

Effects of noise injection during navigation.

a) Ratemap population vector Pearson correlation between timepoints of 800-step trajectories in the square environment. At timestep 400, additive Gaussian noise (with standard deviation σ) is injected into the recurrent state (g). The top row shows correlations for different noise levels (σ = 0, 0.01, 0.1, and 1.0). The bottom row features ratemaps of the four units with largest mean activity, at different timepoints. Ratemaps are shown for σ = 0 and σ = 1.0. b) Same as a), but for output units (p).

Low-dimensional behavior of the trained recurrent network.

a) Low-dimesional UMAP projection of the recurrent (top) and output unit (bottom) activity for a trajectory visiting all six environments. The color of a point in the cloud corresponds to the environment identity. b) Fractional and cumulative explained variance using PCA for recurrent units for each environment. c) similar to b) but for output units. (color scheme as in a). d) Eigenvalue spectrum of the recurrent weight matrix. The unit circle (gray) is inset for reference. e) Jitter plots of context weights corresponding to each environment. For every environment, the weight to each recurrent unit is indicated. f) Pearson correlation between context weights corresponding to different environments.

Output unit centers reside in hexagon-like arrangements.

a) Center locations for each output unit (p) in every geometry, decoded from 100, 30000-timestep trajectories for units with high spatial information. Decoded centers are shaded by unit identity. b) Center locations and marginal distributions of centers in each environment, for active units along a single trajectory. c) Displacement of centers between environments for units with high spatial information. Every unit is color coded by its spatial location in the environment on the diagonal. For each row, the distribution of the included units are shown in every other environment. d) Same as c), but for all units. e) Experimental CA1 place field centers decoded from ratemaps for a mouse foraging in a square 75 × 75 cm environment (left) and corresponding kernel density estimate (right). f) Ripley’s H for the field centers in e) and random (uniform) distributions on the same 15 × 15 grid as in e). The shaded region indicates two standard deviations for 100 random, uniform samplings of the grid.

Error distribution for long sequence evaluation.

Each pane shows the distribution and median of Euclidean distances (error) between true and decoded trajectories for the trained RNN evaluated on 100 long (10000 timestep) test trajectories in a particular environment (inset). The color indicates the kernel density estimate value at a particular timestep.

Ratemaps of all 100 output units in each environment.

The geometry is indicated atop every ensemble. Unit identity is given by its location on the grid (e.g. unit 1 is top left in each environment).

Ratemaps of 100 recurrent units in each environment.

The geometry is indicated atop every ensemble. Unit identity is given by its location on the grid (e.g. unit 1 is top left in each environment).

Place cell center distributions in mice.

From left to right; trajectories, as well as example ratemaps of CA1 place cells in mice (animal indicated by title), next to kernel density estimates of field center locations (locations of maximal firing rate) for cells with high spatial information. Inset is the number of included cells (n) and grid score of the KDE. Also shown is a KDE over maximum locations, alongside the corresponding maximum location grid score (peak GS). The rightmost panel shows Ripley’s H for all place cell peak locations.

Representational stability after velocity ablation.

a) Output unit ratemap population vector correlations between all timesteps for trajectories visiting the square environment, with noise injected at timestep t = 400. Velocity input is ablated after noise injection. b) As in a), but for recurrent units. c) Ratemaps of output units before and after noise injection, for varying noise scales σ. d) Distribution of maximum firing rates for all recurrent units across all timesteps, when no noise is injected.

Recurrent representations in a rhombus environment.

Spatial representations of all 500 recurrent units for a model trained in a rotated square (rhombus) environment.

Ratemaps during context-geometry mismatch.

Ratemaps of 25 randomly selected output units, evaluated in all geometries, when the context signal is fixed equal to the square context signal (A).

Rate differences for recurrent units across all environments.

Included are differences when comparing rates between the environment illustrated on the diagonal and all other environents (columns; illustrated in top inset). Note that differences are (anti-)symmetric.