Skip to content

cargonriv/linked-lca

Repository files navigation

PyTorch Implementation of the LCA Sparse Coding Algorithm for Linked Datasets

tests codecov Code style: black License: MIT

Linked-LCA (lcapt, forked) provides the ability to flexibly build single- or multi-layer convolutional sparse coding networks in PyTorch with the Locally Competitive Algorithm (LCA) on linked data to infer behavior. LCA-Pytorch currently supports 1D, 2D, and 3D convolutional LCA layers, which maintain all the functionality and behavior of PyTorch convolutional layers. We currently do not support Linear (a.k.a. fully-connected) layers, but it is possible to implement the equivalent of a Linear layer with convolutions.

LCA is a neuroscientific model that performs sparse coding by modeling the feature specific lateral competition observed throughout many different sensory areas in the brain, including the visual cortex. Under lateral competition, neurons with overlapping receptive fields compete to represent a shared portion of the input. This is a discrete implementation, but LCA can also be implemented in analog circuits and neuromorphic chips, such as IBM's TrueNorth and Intel's Loihi.

Installation

Pip Installation

pip install git+https://github.com/cargonriv/linked-lca.git

Manual Installation

git clone [email protected]:cargonriv/linked-lca.git
cd linked-lca
pip install .

LCA Parameters

Below is a mapping between the variable names used in this implementation and those used in Rozell et al.'s formulation of LCA.

LCA-PyTorch Variable Rozell Variable Description
input_drive b(t) Drive from the inputs/stimulus
states u(t) Internal state/membrane potential
acts a(t) Code/Representation/External Communication
lambda_ Transfer function threshold value
weights Dictionary/Features
inputs s(t) Input data
recons Reconstruction of the input s(t)

Examples

Pretrained Dictionaries

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages