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
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.
pip install multigeom, with [paper] and [all].
Check an encoder, compute \(J(x)\) and \(G(x)\), run the pipeline.
Notebooks from “bring your own encoder” to the figures of the paper.
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)
Links#
Source code and tutorials
Paper code, the frozen record of the published results
Licensing#
The code is released under the MIT license. The datasets used in the paper keep their own licenses.
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}
}