API Reference#
GLMs#
Classes for creating Generalized Linear Models (GLMs) for both single neurons and neural populations.
Generalized Linear Model (GLM) for neural activity data. |
|
Generalized Linear Model for multi-class classification. |
|
Population Generalized Linear Model. |
|
Population Generalized Linear Model for multi-class classification. |
GLM-HMM#
Classes for creating Hidden Markov models (HMMs) with Generalized Linear Models (GLMs) observations.
Generalized Linear Model with Hidden Markov Model (GLM-HMM). |
Bases#
Provides basis function classes to construct and transform features for model inputs. Basis can be grouped according to the mode of operation into basis that performs convolution and basis that operates as non-linear maps.
The Abstract Classes:
These classes are the building blocks for the concrete basis classes.
Abstract base class for defining basis functions for feature transformation. |
SplineBasis class inherits from the Basis class and represents spline basis functions. |
Bases For Convolution:
M-spline basis functions for modeling and data transformation. |
|
B-spline 1-dimensional basis functions. |
|
B-spline 1-dimensional basis functions for cyclic splines. |
|
Represent linearly-spaced raised cosine basis functions. |
|
Represent log-spaced raised cosine basis functions. |
|
Set of 1D basis decaying exponential functions numerically orthogonalized. |
|
Basis for history effects. |
Bases For Non-Linear Mapping:
M-spline basis functions for modeling and data transformation. |
|
B-spline 1-dimensional basis functions. |
|
B-spline 1-dimensional basis functions for cyclic splines. |
|
Represent linearly-spaced raised cosine basis functions. |
|
Represent log-spaced raised cosine basis functions. |
|
N-dimensional Fourier basis for feature expansion. |
|
Set of 1D basis decaying exponential functions numerically orthogonalized. |
|
Identity basis function. |
|
Zero basis function. |
Composite Bases:
Class representing the addition of two Basis objects. |
|
Class representing the multiplication (external product) of two Basis objects. |
Custom defined Basis:
Define a fully functional basis form a list of functions.
Custom basis class. |
Basis As scikit-learn Tranformers:
Basis as |
Observation Models#
Statistical models to describe the distribution of neural responses or other predicted variables, given inputs.
Abstract observation model class for neural data processing. |
|
Model observations as Poisson random variables. |
|
Model observations as Gaussian random variables. |
|
A Negative Binomial model for overdispersed count data using mean-dispersion parameterization. |
|
Model observations as Gamma random variables. |
|
Model observations as Bernoulli random variables. |
|
Model observations as Categorical random variables. |
Regularizers#
Implements various regularization techniques to constrain model parameters, which helps prevent overfitting.
Abstract base class for regularized solvers. |
|
Regularizer class for unregularized models. |
|
Regularizer class for Ridge (L2 regularization). |
|
Regularizer class for Lasso (L1 regularization). |
|
Regularizer class for Elastic Net (L1 + L2 regularization). |
|
Regularizer class for Group Lasso (group-L1) regularized models. |
IO#
Save and load NeMoS models.
Load a previously saved nemos model from a .npz file. |
|
Examine a saved model parameter file (.npz). |
Solvers#
Functions for interacting with the JAX-based optimizers used for parameter fitting.
Solver registry functions#
Helpers to look up or register solvers.
Fetch the solver spec. |
|
Get the documentation of a specified solver, including accepted arguments and the docstring of its __init__. |
|
List all available solvers. |
|
List the available algorithms that can be used for fitting models. |
|
List the available backends for an algorithm. |
|
Register a solver implementation in the registry. |
|
Set the default backend for a given algorithm. |
|
Solver specification representing an entry in the solver registry. |
Wrapping existing solvers#
Adapter classes for existing solvers, especially those defined in the JAXopt, Optimistix, or Optax libraries.
Base class for adapters wrapping existing solvers. |
|
Base class for adapters wrapping JAXopt-style solvers. |
|
Base class for adapters wrapping Optimistix minimizers. |
|
Adapter for optimistix.OptaxMinimiser which is an adapter for Optax solvers. |
Writing custom solvers#
Classes useful for creating completely custom solvers.
Base class defining the interface for solvers that can be used by BaseRegressor. |
|
Basic diagnostic information about finished optimization runs. |
|
Protocol mirroring the interface of AbstractSolver. |
|
Validate required methods against AbstractSolver and optionally run a quick ridge regression. |
See also
The developer notes explain the solver contract and expected types in more detail.
Convolution utilities#
Utility functions for running convolution over the sample axis.
Create a convolutional predictor by convolving a basis matrix with a time series. |
Simulations utilities#
Utility functions for simulating spiking activity in recurrently connected neural populations.
Simulate neural activity using the GLM as a recurrent network. |
|
Generate coupling filter as a Gamma pdf difference. |
|
Approximate scipy.stats.gamma based filters with basis function. |
Identifiability utilities#
Functions to apply identifiability constraints to rank-deficient feature matrices, ensuring the uniqueness of model solutions.
Apply identifiability constraints to a design matrix |
|
Apply identifiability constraint to a design matrix for each component of an additive basis. |