Open source retina model architectures and training setups
Project description
OpenRetina 
Open-source repository containing neural network models of the retina. The models in this repository are inspired by and partially contain adapted code of sinzlab/neuralpredictors.
Installation
For development and to have access to Jupyter notebooks:
git clone git@github.com:open-retina/open-retina.git
cd open-retina
pip install -e .
For normal usage:
pip install openretina
Test openretina by downloading a model and running a forward pass:
import torch
from openretina.models import *
model = load_core_readout_from_remote("hoefling_2024_base_low_res", "cpu")
responses = model.forward(torch.rand(model.stimulus_shape(time_steps=50)))
Contributing
Before raising a PR please run:
# Fix formatting of python files
make fix-formatting
# Run type checks and unit tests
make test-all
Design decisions and structure
With this repository we provide already pre-trained retina models that can be used for inference and intepretability out of the box, and dataloaders together with model architectures to train new models. For training new models, we rely on pytorch lightning in combination with hydra to manage the configurations for training and dataloading.
The openretina package is structured as follows:
- modules: pytorch modules that define layers and losses
- models: pytorch lightning models that define models that can be trained and evaluated (i.e. models from specific papers)
- data_io: dataloaders to manage access of data to be used for training
- insilico: Methods perform insilico experiments with above models
- stimulus_optimization: optimize inputs for neurons of above models according to interpretable objectives (e.g. most exciting inputs)
- future options: gradient analysis, data analysis
- utils: Utility functions that are used across above submodules
Related papers
The Core + Readout model was developed in the paper A chromatic feature detector in the retina signals visual context changes. All datasets used in openretina are shared under a CC-BY Share-Alike license, and we acknowledge and credit the original sources below:
- hoefling_2024: Originally published by Höfling et al. (2024), eLife: A chromatic feature detector in the retina signals visual context changes.
- karamanlis_2024: Originally published by Karamanlis et al. (2024), Nature: Nonlinear receptive fields evoke redundant retinal coding of natural scenes
- maheswaranathan_2023: Originally published by Maheswaranathan et al. (2023), Neuron: Interpreting the retinal neural code for natural scenes: From computations to neurons
The paper Most discriminative stimuli for functional cell type clustering explains the discriminatory stimulus objective we showcase in notebooks/most_discriminative_stimulus.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openretina-0.3.1.tar.gz.
File metadata
- Download URL: openretina-0.3.1.tar.gz
- Upload date:
- Size: 125.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
005933f459213a808623f6f5de3b203f6d86dc48e8f888d54b7b19fb115ef7e4
|
|
| MD5 |
7bca93ea74cdbb73bbfe52e00ec172f4
|
|
| BLAKE2b-256 |
841e68f3c7e816d32c28e632a1c94e131fcc1f240e57f33775d04c8df85d5b60
|
Provenance
The following attestation bundles were made for openretina-0.3.1.tar.gz:
Publisher:
publish-to-pypi.yml on open-retina/open-retina
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openretina-0.3.1.tar.gz -
Subject digest:
005933f459213a808623f6f5de3b203f6d86dc48e8f888d54b7b19fb115ef7e4 - Sigstore transparency entry: 178556633
- Sigstore integration time:
-
Permalink:
open-retina/open-retina@0c62f0db1c06f447ac779b3503821b6ae6327519 -
Branch / Tag:
refs/tags/release-v1.0.0 - Owner: https://github.com/open-retina
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@0c62f0db1c06f447ac779b3503821b6ae6327519 -
Trigger Event:
push
-
Statement type:
File details
Details for the file openretina-0.3.1-py3-none-any.whl.
File metadata
- Download URL: openretina-0.3.1-py3-none-any.whl
- Upload date:
- Size: 149.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb65db666e05614574a4d2f0feb2a6c31b377f0d6b864f1d1cd25e0f4849dd5a
|
|
| MD5 |
e8601e6cf865eeff18b87494ceeac82f
|
|
| BLAKE2b-256 |
97473b3f6fb702921e467f09093a29a4530d8a4f93e5276b9d179da4a255be5c
|
Provenance
The following attestation bundles were made for openretina-0.3.1-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on open-retina/open-retina
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openretina-0.3.1-py3-none-any.whl -
Subject digest:
bb65db666e05614574a4d2f0feb2a6c31b377f0d6b864f1d1cd25e0f4849dd5a - Sigstore transparency entry: 178556637
- Sigstore integration time:
-
Permalink:
open-retina/open-retina@0c62f0db1c06f447ac779b3503821b6ae6327519 -
Branch / Tag:
refs/tags/release-v1.0.0 - Owner: https://github.com/open-retina
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@0c62f0db1c06f447ac779b3503821b6ae6327519 -
Trigger Event:
push
-
Statement type: