8000 GitHub - pollytur/open-retina: Collaborative retina modelling across datasets and species.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

pollytur/open-retina

 
 

Repository files navigation

OpenRetina

Ruff mypy pytorch lightning hydra DOI

huggingface

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. Accompanying preprint: openretina: Collaborative Retina Modelling Across Datasets and Species.

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:

The paper Most discriminative stimuli for functional cell type clustering explains the discriminatory stimulus objective we showcase in notebooks/most_discriminative_stimulus.

About

Collaborative retina modelling across datasets and species.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Jupyter Notebook 79.9%
  • Python 19.9%
  • Other 0.2%
0