Skip to content

Commit b2357fd

Browse files
authored
v0.5.0 (#238)
1 parent 4901966 commit b2357fd

File tree

13 files changed

+95
-71
lines changed

13 files changed

+95
-71
lines changed

AUTHORS.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,25 @@
22

33

44

5-
CEBRA was initially developed by **Mackenzie Mathis** and **Steffen Schneider** (2021+), who are co-inventors on the patent application [WO2023143843](https://infoscience.epfl.ch/entities/patent/0d9debed-4d22-47b7-bad1-f211e7010323).
6-
**Jin Hwa Lee** contributed significantly to our first paper:
5+
CEBRA was initially developed by **Mackenzie Mathis** and **Steffen Schneider** (2021+), who are co-inventors on the patent application [WO2023143843](https://infoscience.epfl.ch/entities/patent/0d9debed-4d22-47b7-bad1-f211e7010323).
6+
**Jin Hwa Lee** contributed significantly to our first paper:
77

8-
> **Schneider, S., Lee, J.H., & Mathis, M.W.**
9-
> [*Learnable latent embeddings for joint behavioural and neural analysis.*](https://doi.org/10.1038/s41586-023-06031-6)
8+
> **Schneider, S., Lee, J.H., & Mathis, M.W.**
9+
> [*Learnable latent embeddings for joint behavioural and neural analysis.*](https://doi.org/10.1038/s41586-023-06031-6)
1010
> Nature 617, 360–368 (2023)
1111
12-
CEBRA is actively developed by [**Mackenzie Mathis**](https://www.mackenziemathislab.org/) and [**Steffen Schneider**](https://dynamical-inference.ai/) and their labs.
12+
CEBRA is actively developed by [**Mackenzie Mathis**](https://www.mackenziemathislab.org/) and [**Steffen Schneider**](https://dynamical-inference.ai/) and their labs.
1313

14-
It is a publicly available tool that has benefited from contributions and suggestions from many individuals: [CEBRA/graphs/contributors](https://github.com/AdaptiveMotorControlLab/CEBRA/graphs/contributors).
14+
It is a publicly available tool that has benefited from contributions and suggestions from many individuals: [CEBRA/graphs/contributors](https://github.com/AdaptiveMotorControlLab/CEBRA/graphs/contributors).
1515

16-
## CEBRA Extensions
16+
## CEBRA Extensions
1717

18-
### 2023
19-
- **Steffen Schneider, Rodrigo González Laiz, Markus Frey, Mackenzie W. Mathis**
20-
[*Identifiable attribution maps using regularized contrastive learning.*](https://sslneurips23.github.io/paper_pdfs/paper_80.pdf)
18+
### 2023
19+
- **Steffen Schneider, Rodrigo González Laiz, Markus Frey, Mackenzie W. Mathis**
20+
[*Identifiable attribution maps using regularized contrastive learning.*](https://sslneurips23.github.io/paper_pdfs/paper_80.pdf)
2121
NeurIPS 4th Workshop on Self-Supervised Learning: Theory and Practice (2023)
2222

23-
### 2025
24-
- **Steffen Schneider, Rodrigo González Laiz, Anastasiia Filippova, Markus Frey, Mackenzie W. Mathis**
25-
[*Time-series attribution maps with regularized contrastive learning.*](https://openreview.net/forum?id=aGrCXoTB4P)
23+
### 2025
24+
- **Steffen Schneider, Rodrigo González Laiz, Anastasiia Filippova, Markus Frey, Mackenzie W. Mathis**
25+
[*Time-series attribution maps with regularized contrastive learning.*](https://openreview.net/forum?id=aGrCXoTB4P)
2626
AISTATS (2025)
27-
28-

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ RUN make dist
4040
FROM cebra-base
4141

4242
# install the cebra wheel
43-
ENV WHEEL=cebra-0.5.0rc1-py3-none-any.whl
43+
ENV WHEEL=cebra-0.5.0-py3-none-any.whl
4444
WORKDIR /build
4545
COPY --from=wheel /build/dist/${WHEEL} .
4646
RUN pip install --no-cache-dir ${WHEEL}'[dev,integrations,datasets]'

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CEBRA_VERSION := 0.5.0rc1
1+
CEBRA_VERSION := 0.5.0
22

33
dist:
44
python3 -m pip install virtualenv

PKGBUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Maintainer: Steffen Schneider <[email protected]>
22
pkgname=python-cebra
33
_pkgname=cebra
4-
pkgver=0.5.0rc1
4+
pkgver=0.5.0
55
pkgrel=1
66
pkgdesc="Consistent Embeddings of high-dimensional Recordings using Auxiliary variables"
77
url="https://cebra.ai"

cebra/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666

6767
import cebra.integrations.sklearn as sklearn
6868

69-
__version__ = "0.5.0rc1"
69+
__version__ = "0.5.0"
7070
__all__ = ["CEBRA"]
7171
__allow_lazy_imports = False
7272
__lazy_imports = {}

cebra/integrations/plotly.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
import numpy as np
2828
import numpy.typing as npt
2929
import plotly.graph_objects
30-
import torch
3130
import plotly.graph_objects as go
31+
import torch
3232

3333
from cebra.integrations.matplotlib import _EmbeddingPlot
3434

@@ -153,17 +153,18 @@ def _plot_3d(self, **kwargs) -> plotly.graph_objects.Figure:
153153

154154

155155
def plot_embedding_interactive(
156-
embedding: Union[npt.NDArray, torch.Tensor],
157-
embedding_labels: Optional[Union[npt.NDArray, torch.Tensor, str]] = "grey",
158-
axis: Optional["go.Figure"] = None,
159-
markersize: float = 1,
160-
idx_order: Optional[Tuple[int]] = None,
161-
alpha: float = 0.4,
162-
cmap: str = "cool",
163-
title: str = "Embedding",
164-
figsize: Tuple[int] = (5, 5),
165-
dpi: int = 100,
166-
**kwargs,
156+
embedding: Union[npt.NDArray, torch.Tensor],
157+
embedding_labels: Optional[Union[npt.NDArray, torch.Tensor,
158+
str]] = "grey",
159+
axis: Optional["go.Figure"] = None,
160+
markersize: float = 1,
161+
idx_order: Optional[Tuple[int]] = None,
162+
alpha: float = 0.4,
163+
cmap: str = "cool",
164+
title: str = "Embedding",
165+
figsize: Tuple[int] = (5, 5),
166+
dpi: int = 100,
167+
**kwargs,
167168
) -> "go.Figure":
168169
"""Plot embedding in a 3D dimensional space.
169170

docs/root/index.html

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,16 @@ <h4>
145145
</div>
146146

147147
<div class="row mb-5 mt-4">
148-
<p>CEBRA is a machine-learning method that can be used to
148+
<p>CEBRA is a machine-learning method that can be used to
149149
compress time series in a way that reveals otherwise hidden
150-
structures in the variability of the data. It excels on
151-
behavioural and neural data recorded simultaneously.
150+
structures in the variability of the data. It excels on
151+
behavioural and neural data recorded simultaneously.
152152
We have shown it can be used to decode the activity from the
153153
visual cortex of the mouse brain to reconstruct a viewed video,
154154
to decode trajectories from the sensoirmotor cortex of primates,
155155
and for decoding position during navigation. For these use cases
156156
and other demos see our <a href="https://cebra.ai/docs/" style="color: #6235E0;">Documentation</a>.</p>
157-
157+
158158
</div>
159159

160160
<div class="row">
@@ -171,12 +171,12 @@ <h3><i class="fas fa-play-circle"></i> Demo Applications</h3>
171171
<div class="col-md-6 mb-2">
172172
<!-- Embedding the Plotly figure using iframe -->
173173
<div style="position: relative; height: 315px; overflow: hidden; margin-bottom: 1rem;">
174-
<iframe src="static/img/hippocampus_posdir3_full.html"
174+
<iframe src="static/img/hippocampus_posdir3_full.html"
175175
style="position: absolute; top: -140px; left: -5%; width: 110%; height: 150%; border: none; transform: scale(0.85); transform-origin: top center;"
176176
scrolling="no">
177177
</iframe>
178178
</div>
179-
179+
180180
<p style="margin-top: -70px;">Interactive visualization of the CEBRA embedding for the rat hippocampus data. This 3D plot shows how neural activity is mapped to a lower-dimensional space that correlates with the animal's position and movement direction. <a href="https://colab.research.google.com/github/AdaptiveMotorControlLab/CEBRA-demos/blob/main/Demo_hippocampus.ipynb" target="_blank" style="color: #6235E0;"><i class="fas fa-external-link-alt"></i> Open In Colaboratory</a></p>
181181
</div>
182182
</div>
@@ -191,7 +191,7 @@ <h3><i class="fas fa-play-circle"></i> Demo Applications</h3>
191191
<p>CEBRA applied to mouse primary visual cortex, collected at the Allen Institute (de Vries et al. 2020, Siegle et al. 2021). 2-photon and Neuropixels recordings are embedded with CEBRA using DINO frame features as labels.
192192
The embedding is used to decode the video frames using a kNN decoder on the CEBRA-Behavior embedding from the test set.</p>
193193
</div>
194-
194+
195195
<div class="col-md-6 mb-2">
196196
<!-- YouTube embed for CEBRA on M1 and S1 neural data with cleaner styling -->
197197
<video width="100%" autoplay loop muted preload="auto">
@@ -205,7 +205,7 @@ <h3><i class="fas fa-play-circle"></i> Demo Applications</h3>
205205

206206
<div class="row mt-4">
207207
<h3><i class="fas fa-newspaper"></i> Publications</h3>
208-
208+
209209
<div class="col-12">
210210
<div class="paper-card">
211211
<div class="paper-title">Learnable latent embeddings for joint behavioural and neural analysis</div>
@@ -215,7 +215,7 @@ <h3><i class="fas fa-newspaper"></i> Publications</h3>
215215
<a href="https://arxiv.org/abs/2204.00673" target="_blank" class="btn btn-link" style="color: #6235E0;"><i class="fas fa-file-alt"></i> Preprint</a>
216216
</div>
217217
</div>
218-
218+
219219
<div class="col-12">
220220
<div class="paper-card">
221221
<div class="paper-title">Time-series attribution maps with regularized contrastive learning</div>
@@ -230,7 +230,7 @@ <h3><i class="fas fa-newspaper"></i> Publications</h3>
230230

231231
<div class="row mt-4">
232232
<h3><i class="fas fa-certificate"></i> Patent Information</h3>
233-
233+
234234
<div class="col-12">
235235
<div class="paper-card">
236236
<div class="paper-title">Patent Pending</div>
@@ -299,7 +299,7 @@ <h3>
299299
</small>
300300
</div>
301301
</div>
302-
302+
303303
<div class="row justify-content-md-center">
304304
<div class="col-sm-10 rounded p-3 m-2" style="background-color: rgb(20,20,20);">
305305
<small class="code">
@@ -325,13 +325,13 @@ <h3>
325325
<p>
326326
CEBRA has been cited in numerous high-impact publications across neuroscience, machine learning, and related fields. Our work has influenced research in neural decoding, brain-computer interfaces, computational neuroscience, and machine learning methods for time-series analysis.
327327
</p>
328-
328+
329329
<div class="col-12 text-center mb-4">
330330
<a href="https://scholar.google.com/scholar?oi=bibs&hl=en&cites=5385393104765622341&as_sdt=5" target="_blank" class="btn btn-outline-light btn-lg">
331331
<i class="fas fa-graduation-cap"></i> View All Citations on Google Scholar
332332
</a>
333333
</div>
334-
334+
335335
<div class="col-12">
336336
<div class="paper-card">
337337
<p class="mb-0">Our research has been cited in proceedings and journals including <span class="badge bg-light text-dark">Nature</span> <span class="badge bg-light text-dark">Science</span> <span class="badge bg-light text-dark">ICML</span> <span class="badge bg-light text-dark">Nature Neuroscience</span> <span class="badge bg-light text-dark">ICML</span> <span class="badge bg-light text-dark">Neuron</span> <span class="badge bg-light text-dark">NeurIPS</span> <span class="badge bg-light text-dark">ICLR</span> and others.</p>
@@ -342,8 +342,8 @@ <h3>
342342
<div class="row justify-content-center mt-5 mb-3">
343343
<div class="col-md-12 text-center">
344344
<a href="https://www.epfl.ch/" target="_blank">
345-
<img src="https://images.squarespace-cdn.com/content/v1/57f6d51c9f74566f55ecf271/00b1fa45-9246-4914-86ee-4a01bb3fb60b/logo.png?format=2500w"
346-
alt="MLAI Logo"
345+
<img src="https://images.squarespace-cdn.com/content/v1/57f6d51c9f74566f55ecf271/00b1fa45-9246-4914-86ee-4a01bb3fb60b/logo.png?format=2500w"
346+
alt="MLAI Logo"
347347
style="max-width: 600px;">
348348
</a>
349349
<div class="mt-3">

docs/source/conf.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ def get_years(start_year=2021):
8181
"sphinx_gallery.load_style",
8282
]
8383

84-
8584
coverage_show_missing_items = True
8685
panels_add_bootstrap_css = False
8786

@@ -147,7 +146,8 @@ def get_years(start_year=2021):
147146
html_context = {
148147
"default_mode": "light",
149148
"switcher": {
150-
"version_match": "latest", # Adjust this dynamically per version
149+
"version_match":
150+
"latest", # Adjust this dynamically per version
151151
"versions": [
152152
("latest", "/latest/"),
153153
("v0.2.0", "/v0.2.0/"),
@@ -156,7 +156,8 @@ def get_years(start_year=2021):
156156
("v0.5.0rc1", "/v0.5.0rc1/"),
157157
],
158158
},
159-
"navbar_start": ["version-switcher", "navbar-logo"], # Place the dropdown above the logo
159+
"navbar_start": ["version-switcher",
160+
"navbar-logo"], # Place the dropdown above the logo
160161
}
161162

162163
# More info on theme options:
@@ -220,7 +221,7 @@ def get_years(start_year=2021):
220221

221222
nbsphinx_thumbnails = {
222223
"demo_notebooks/CEBRA_best_practices":
223-
"_static/thumbnails/cebra-best.png",
224+
"_static/thumbnails/cebra-best.png",
224225
"demo_notebooks/Demo_primate_reaching":
225226
"_static/thumbnails/ForelimbS1.png",
226227
"demo_notebooks/Demo_hippocampus":

docs/source/usage.rst

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,36 +1218,36 @@ Putting all previous snippet examples together, we obtain the following pipeline
12181218
output_dimension = 8,
12191219
verbose = False
12201220
)
1221-
1221+
12221222
# 2. Load example data
12231223
neural_data = cebra.load_data(file="neural_data.npz", key="neural")
12241224
new_neural_data = cebra.load_data(file="neural_data.npz", key="new_neural")
12251225
continuous_label = cebra.load_data(file="auxiliary_behavior_data.h5", key="auxiliary_variables", columns=["continuous1", "continuous2", "continuous3"])
12261226
discrete_label = cebra.load_data(file="auxiliary_behavior_data.h5", key="auxiliary_variables", columns=["discrete"]).flatten()
1227-
1228-
1227+
1228+
12291229
assert neural_data.shape == (100, 3)
12301230
assert new_neural_data.shape == (100, 4)
12311231
assert discrete_label.shape == (100, )
12321232
assert continuous_label.shape == (100, 3)
1233-
1233+
12341234
# 3. Split data and labels into train/validation
12351235
from sklearn.model_selection import train_test_split
1236-
1236+
12371237
split_idx = int(0.8 * len(neural_data))
12381238
# suggestion: 5%-20% depending on your dataset size; note that this splits the
12391239
# into an early and late part, which might not be ideal for your data/experiment!
12401240
# As a more involved alternative, consider e.g. a nested time-series split.
1241-
1241+
12421242
train_data = neural_data[:split_idx]
12431243
valid_data = neural_data[split_idx:]
1244-
1244+
12451245
train_continuous_label = continuous_label[:split_idx]
12461246
valid_continuous_label = continuous_label[split_idx:]
1247-
1247+
12481248
train_discrete_label = discrete_label[:split_idx]
12491249
valid_discrete_label = discrete_label[split_idx:]
1250-
1250+
12511251
# 4. Fit the model
12521252
# time contrastive learning
12531253
cebra_model.fit(train_data)
@@ -1257,29 +1257,29 @@ Putting all previous snippet examples together, we obtain the following pipeline
12571257
cebra_model.fit(train_data, train_continuous_label)
12581258
# mixed behavior contrastive learning
12591259
cebra_model.fit(train_data, train_discrete_label, train_continuous_label)
1260-
1261-
1260+
1261+
12621262
# 5. Save the model
12631263
tmp_file = Path(tempfile.gettempdir(), 'cebra.pt')
12641264
cebra_model.save(tmp_file)
1265-
1265+
12661266
# 6. Load the model and compute an embedding
12671267
cebra_model = cebra.CEBRA.load(tmp_file)
12681268
train_embedding = cebra_model.transform(train_data)
12691269
valid_embedding = cebra_model.transform(valid_data)
1270-
1270+
12711271
assert train_embedding.shape == (80, 8) # TODO(user): change to split ratio & output dim
12721272
assert valid_embedding.shape == (20, 8) # TODO(user): change to split ratio & output dim
1273-
1273+
12741274
# 7. Evaluate the model performance (you can also check the train_data)
12751275
goodness_of_fit = cebra.sklearn.metrics.goodness_of_fit_score(cebra_model,
12761276
valid_data,
12771277
valid_discrete_label,
12781278
valid_continuous_label)
1279-
1279+
12801280
# 8. Adapt the model to a new session
12811281
cebra_model.fit(new_neural_data, adapt = True)
1282-
1282+
12831283
# 9. Decode discrete labels behavior from the embedding
12841284
decoder = cebra.KNNDecoder()
12851285
decoder.fit(train_embedding, train_discrete_label)

reinstall.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pip uninstall -y cebra
1515
# Get version info after uninstalling --- this will automatically get the
1616
# most recent version based on the source code in the current directory.
1717
# $(tools/get_cebra_version.sh)
18-
VERSION=0.5.0rc1
18+
VERSION=0.5.0
1919
echo "Upgrading to CEBRA v${VERSION}"
2020

2121
# Upgrade the build system (PEP517/518 compatible)

0 commit comments

Comments
 (0)