multigeom#

Multi-scale information geometry of neural population codes, in Python.

multigeom computes the Fisher information metric \(J(x)\) of any fitted PyTorch model of neural responses, and the multi-scale Fisher metric

\[G(x) = \int_0^\infty [\phi_t * J_t](x)\,dt ,\]

the Fisher information of the stimulus-diffused likelihood integrated over all diffusion scales. \(G(x)\) is exactly related to the mutual information between stimulus and response: stimulus directions that are well encoded are expanded, poorly encoded ones are contracted. For natural images it is estimated with a conditional diffusion model, and its leading eigenvectors show which image features a neural population encodes best. The package also reproduces the macaque V1 and V4 analyses of the paper.

Installation

pip install multigeom, with [paper] and [all].

Installation
Usage

Check an encoder, compute \(J(x)\) and \(G(x)\), run the pipeline.

Usage
Demos

Notebooks from “bring your own encoder” to the figures of the paper.

Demo Notebooks

Quick start#

import multigeom

multigeom.validate_encoder(encoder)               # checks the encoder contract (any fitted PyTorch model)

# The leading eigenvalues and eigenvectors of J(x) at an image x:
fisher = multigeom.compute_fisher(image=x, encoder=encoder, sigma=0.22, top_k=10)
print(fisher.eigenvalues, fisher.eigenvectors.shape)

Licensing#

The code is released under the MIT license. The datasets used in the paper keep their own licenses.

Authors#

Simone Azeglio, Steeve Laquitaine, Ulisse Ferrari and Matthew Chalk (Institut de la Vision, INSERM, CNRS, Sorbonne Université).

Key reference#

Azeglio, S., Laquitaine, S., Ferrari, U., Chalk, M. A multi-scale information geometry reveals the structure of mutual information in neural populations. Advances in Neural Information Processing Systems (NeurIPS), 2026.

@inproceedings{azeglio2026multiscale,
  title     = {A multi-scale information geometry reveals the structure of mutual information in neural populations},
  author    = {Azeglio, Simone and Laquitaine, Steeve and Ferrari, Ulisse and Chalk, Matthew},
  booktitle = {Advances in Neural Information Processing Systems},
  year      = {2026}
}