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).

Getting Started

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.

Usage Guide

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.

API Reference

For detailed information about flyvis’ components and functions, please refer to our API Reference section. This includes documentation for things like

  • Core components like Connectomes, Network, NetworkView, EnsembleView
  • Analysis tools for flash responses, moving stimuli, optimal stimuli generation, ensemble clustering
  • Command line tools for training, validation, and analysis

Command Line Interface

For running experiments and analysis pipelines, check out our Command Line Interface documentation. This provides tools for training models, running analysis, and managing experiments on compute clusters.

Projects using or building upon flyvis:

  • NeuroMechFly: A neuromechanical model of the adult fruit fly that integrates our visual system model for sensory processing.

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.