Skip to content

Flyvis Documentation

A connectome-constrained deep mechanistic network (DMN) model of the fruit fly visual system in PyTorch.

  • Explore connectome-constrained models of the fruit fly visual system.
  • Generate and test hypotheses about neural computations.
  • Try pretrained models on your data.
  • Develop custom models using our framework.

Flyvis is our official implementation of Lappalainen et al., “Connectome-constrained networks predict neural activity across the fly visual system.” Nature (2024).

Usage Guide

To get started we recommend going through our tutorials. These will guide you through the core concepts and provide practical examples:

Tutorials

  1. Explore the Connectome: Learn about the structure of the fly visual system connectome.
  2. Train the Network: Understand how to train the network on an optic flow task.
  3. Flash Responses: Explore how the model responses to flash stimuli.
  4. Moving Edge Responses: Analyze the model’s responses to moving edge stimuli.
  5. Ensemble Clustering: Learn about clustering ensembles of models.
  6. Maximally Excitatory Stimuli: Discover how to find stimuli that maximally excite neurons.
  7. Custom Stimuli: Learn how to provide your own custom stimuli to the model.

Main Results

These notebooks show the main results of the paper:

  1. Fig. 1: Connectome-constrained and task-optimized models of the fly visual system.
  2. Fig. 2: Ensembles of DMNs predict tuning properties.
  3. Fig. 3: Cluster analysis of DMN ensembles enables hypothesis generation and suggests experimental tests.
  4. Fig. 4: Task-optimal DMNs largely recapitulate known mechanisms of motion computation.

API Reference

For detailed information about flyvis’ components and functions, please refer to our API Reference section. This includes documentation for key modules such as Connectomes, Network, NetworkView, and more.

Scripts

We also provide a set of scripts for various tasks, including data download, training, validation, and analysis. You can start with the Scripts section of our documentation. A good starting point is also the pipeline manager to run the scripts in sequence on either LSF or SLURM compute clouds.

Installation

Quickstart with Google Colab

Try the models and code inside our Google Colab notebooks for a quickstart.

Local Installation

See install.md for details on how to install the package and download the pretrained models.

Citation

@article{lappalainen2024connectome,
    title = {Connectome-constrained networks predict neural activity across the fly visual system},
    issn = {1476-4687},
    url = {https://doi.org/10.1038/s41586-024-07939-3},
    doi = {10.1038/s41586-024-07939-3},
    journal = {Nature},
    author = {Lappalainen, Janne K. and Tschopp, Fabian D. and Prakhya, Sridhama and McGill, Mason and Nern, Aljoscha and Shinomiya, Kazunori and Takemura, Shin-ya and Gruntman, Eyal and Macke, Jakob H. and Turaga, Srinivas C.},
    month = sep,
    year = {2024},
}

If you have any questions or encounter any issues, please check our FAQ or Contributing pages for more information.