laminr

Learning and Aligning Manifolds using Implicit Neural Representations

https://github.com/sinzlab/laminr

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.9%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Learning and Aligning Manifolds using Implicit Neural Representations

Basic Info
  • Host: GitHub
  • Owner: sinzlab
  • License: other
  • Language: Python
  • Default Branch: main
  • Size: 1.12 MB
Statistics
  • Stars: 4
  • Watchers: 4
  • Forks: 2
  • Open Issues: 1
  • Releases: 2
Created about 1 year ago · Last pushed about 1 year ago
Metadata Files
Readme License Citation

README.md

LAMINR Logo   [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/sinzlab/laminr/blob/main/examples/laminr_quick_start.ipynb) [![PyPI version](https://badge.fury.io/py/laminr.svg)](https://pypi.org/project/laminr/) [![ICLR 2025 Paper](https://img.shields.io/badge/Paper-ICLR%202025_(Oral)-CA3FE6.svg?style=flat)](https://openreview.net/forum?id=kbjJ9ZOakb)

LAMINR (Learning and Aligning Manifolds of Single-Neuron Invariances using Implicit Neural Representations) enables the systematic discovery and alignment of invariance manifolds in stimulus space for visual sensory neurons, providing a principled way to characterize and compare neuronal invariances at the population level, independent of nuisance receptive field properties such as position, size, and orientation.

🚀 Highlights

  • Continuous Invariance Manifold Learning: Identifies the full space of stimuli that elicit near-maximal responses from a neuron.
  • Alignment Across Neurons: Learns transformations that align invariance manifolds across neurons, revealing shared invariance properties.
  • Functional Clustering: Enables clustering neurons into distinct functional types based on their invariance properties.
  • Model-Agnostic: Can be applied to any robust response-predicting model of biological neurons.
Method Overview

🛠 Installation

You can install LAMINR using one of the following methods:

1️⃣ Using pip

bash pip install laminr

2️⃣ Via GitHub (Latest Version)

bash pip install git+https://github.com/sinzlab/laminr.git

🔥 Quick Start

Here's a simple example of how to use LAMINR to learn and align invariance manifolds.

Open in Colab

```python from laminr import neuronmodels, getmei_dict, InvarianceManifold

device = "cuda" input_shape = [1, 100, 100] # (channels, height, width)

Load the trained neuron model

model = neuronmodels.simulated("demo1", imgres=input_shape[1:]).to(device)

Generate MEIs (Maximally Exciting Inputs)

imageconstraints = { "pixelvaluelowerbound": -1.0, "pixelvalueupperbound": 1.0, "requiredimgnorm": 1.0, } meisdict = getmeidict(model, inputshape, **imageconstraints)

Initialize the invariance manifold pipeline

invmanifold = InvarianceManifold(model, meisdict, **image_constraints)

Learn invariance manifold for neuron 0 (template)

templateidx = 0 templateimgs, templateactivations = invmanifold.learn(template_idx)

Align the template to neurons 1 and 2

targetidxs = [1, 2] alignedimgs, alignedactivations = invmanifold.match(target_idxs) ```

🐳 Running with Docker

We have provided a Dockerfile for building an image with LAMINR pre-installed. Ensure that both docker and docker-compose are installed on your system.

Follow the steps below to run LAMINR inside a Docker container with Jupyter Lab.

1. Clone the repository and navigate to the project directory: bash git clone https://github.com/sinzlab/laminr.git cd laminr

2. Run the following command inside the directory: bash docker compose run -p 10101:8888 examples This command: - Builds the Docker image and creates a container. - Exposes Jupyter Lab on port 10101.

3. Access Jupyter Lab: Jupyter Lab will launch in the examples folder, which you can open in your browser via localhost:10101 (the token can be found in the terminal logs).

🛠 Questions & Contributions

If you encounter any issues while using the method, please create an Issue on GitHub.

We welcome and appreciate contributions to the package! Feel free to open an Issue or submit a Pull Request for new features.

For other questions or project collaboration inquiries, please contact mohammadbashiri93@gmail.com or loocabaroni@gmail.com.

📜 License

This package is licensed under the Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) License. Briefly: - Attribution Required: You must credit the original authors and indicate if changes were made. - NonCommercial Use Only: This package may not be used for commercial purposes without explicit permission. - No Additional Restrictions: You may not apply legal terms that prevent others from using this package under these terms.

For full details, see the CC BY-NC 4.0 License.
For commercial use inquiries, please contact: mohammadbashiri93@gmail.com.

📖 Paper

ICLR 2025 (Oral): Learning and Aligning Single-Neuron Invariance Manifolds in Visual Cortex
Authors: Mohammad Bashiri, Luca Baroni, Ján Antolík, Fabian H. Sinz. (* denotes equal contribution)

Please cite our work if you find it useful:

bibtex @inproceedings{bashiri2025laminr, title={Learning and Aligning Single-Neuron Invariance Manifolds in Visual Cortex}, author={Bashiri, Mohammad and Baroni, Luca and Antolík, Ján and Sinz, Fabian H.}, booktitle={International Conference on Learning Representations (ICLR)}, year={2025} }

Owner

  • Name: Sinz Lab
  • Login: sinzlab
  • Kind: organization
  • Location: Tübingen, Germany

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Bashiri"
  given-names: "Mohammad"
- family-names: "Baroni"
  given-names: "Luca"
- family-names: "Antolík"
  given-names: "Ján"
- family-names: "Sinz"
  given-names: "Fabian"
title: "Learning and Aligning Single-Neuron Invariance Manifolds in Visual Cortex"
version: 0.0.1
doi: https://openreview.net/forum?id=kbjJ9ZOakb
date-released: 2025-03-01
url: "https://github.com/mohammadbashiri/laminr"

GitHub Events

Total
  • Create event: 4
  • Release event: 2
  • Issues event: 13
  • Watch event: 6
  • Delete event: 4
  • Issue comment event: 6
  • Push event: 38
  • Public event: 1
  • Pull request review event: 2
  • Pull request review comment event: 1
  • Pull request event: 9
  • Fork event: 2
Last Year
  • Create event: 4
  • Release event: 2
  • Issues event: 13
  • Watch event: 6
  • Delete event: 4
  • Issue comment event: 6
  • Push event: 38
  • Public event: 1
  • Pull request review event: 2
  • Pull request review comment event: 1
  • Pull request event: 9
  • Fork event: 2

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 7
  • Total pull requests: 5
  • Average time to close issues: 1 day
  • Average time to close pull requests: 7 minutes
  • Total issue authors: 1
  • Total pull request authors: 2
  • Average comments per issue: 1.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 7
  • Pull requests: 5
  • Average time to close issues: 1 day
  • Average time to close pull requests: 7 minutes
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 1.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • mohammadbashiri (7)
Pull Request Authors
  • mohammadbashiri (4)
  • lucabaroni (1)
Top Labels
Issue Labels
enhancement (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 56 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 7
  • Total maintainers: 1
pypi.org: laminr

Learning and Aligning Manifolds using Implicit Neural Representations.

  • Versions: 7
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 56 Last month
Rankings
Dependent packages count: 9.7%
Average: 32.1%
Dependent repos count: 54.5%
Maintainers (1)
Last synced: 7 months ago

Dependencies

Dockerfile docker
  • sinzlab/pytorch v3.9-torch1.9.0-cuda11.1-dj0.12.7 build
docker-compose.yml docker
  • laminr latest
environment.yml pypi
  • lipstick *
  • torch ==1.13.1
pyproject.toml pypi
requirements.txt pypi
  • huggingface_hub ==0.28.1
  • lipstick ==0.0.7
  • numpy ==1.26.4
  • scikit-image ==0.19.1
  • scipy ==1.13.1
  • torch ==1.13.1
  • tqdm *
requirements_colab.txt pypi
  • lipstick *