Skip to main content

Gaussian Processes for Orientation Preference Maps

This package is a Python implementation of a Gaussian Process (GP) method for inferring cortical maps (Macke et al., 2011), based on their original MATLAB-code. Compared to conventional (vector averaging) approaches, the method computes better maps from little data and can be used to quantify the uncertainty in an estimated orientation preference map (OPM). It also provides a principled way to choose the parameters in the smoothing step and incorporate inhomogeneous noise variances as well as noise correlations.

The basic idea is to specify a prior over OPMs as a GP. This means that a-priori assumptions about correlations of the pixels in a map are specified as a covariance function K. In this case, we use a Difference of Gaussians (DoG) kernel. This covariance function encodes our assumptions that OPMs are smooth and have a semi-periodic structure. This prior is then updated via Bayes' rule with imaging data to obtain a smooth posterior estimate of an OPM.

My notes on the method (including derivations not in the original paper) can be found here.

Installation & Usage

You can clone this package and install all its dependencies using

git clone git@github.com:mackelab/gp-maps-python.git
python -m pip install -r requirements.txt

Alternatively, this module is now pip-installable via

python -m pip install gp-maps-python

A number of Jupyter notebooks illustrate how to use the package:

OPM.ipynb

contains basic functionality for handling OPMs:

  • sample from this prior to obtain a ground truth OPM
  • visualize OPMs
  • simulate neural responses given an OPM and a set of stimuli
  • compute maximum likelihood/vector averaging estimate of the OPM
  • smooth the OPM with a Gaussian kernel

BayesianOPM.ipynb

shows details about the GP method:

  • covariance function (DoG kernel)
  • estimate hyperparameters of the prior covariance function from the empirical map
  • learn noise model iteratively from data
  • posterior inference

FerretData.ipynb

serves as an illustration on how to use GPs to infer OPMs from real imaging data (replicating the results of Macke et al., 2011):

  • visualize inhomogeneous and correlated noise structure of the data
  • obtain smooth estimate based on "ground truth"
  • GP posterior inference on real data

Metadata

Release files for gp-maps-python 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gp-maps-python 0.0.3
File Size Uploaded
gp-maps-python-0.0.3.tar.gz 18.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gp-maps-python 0.0.3
File Interpreter ABI Platform
gp_maps_python-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 56.6 kB

Release files / gp-maps-python-0.0.3.tar.gz

Download URL gp-maps-python-0.0.3.tar.gz
Size 18.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e0bdd9125d538cfbcbc84d5c6b55834b6d1d37ab2dd9982dbc12d76a99ad50a4
BLAKE2b-256 checksum
How to use checksums
fe8f1756ef9188fcb2bd607d25d1fc1576c911c4bea9ff02f9739da503a843d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

Release files / gp_maps_python-0.0.3-py3-none-any.whl

Download URL gp_maps_python-0.0.3-py3-none-any.whl
Size 38.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d388b116d6f28cbed08323d441ea56c187becf0de1f8e0746d5d68b2f4ce540
BLAKE2b-256 checksum
How to use checksums
fe538971d51570482739c3f3e339755e3d109a47e6661ad04682cf901cc8df46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page