As an exercise, I wrote a spiking neural network in R, implemented in a shiny app, that performs some rudimentary unsupervised learning. The app is embedded below. A small set of patterns is used to generate an input spike sequence, and a single hidden layer of spiking neurons uses a leaky integrate and fire (LIF) model with spike-timing dependent plasticity (STDP) to learn the underlying pattern components. The hidden layer uses lateral inhibition, or inhibitory connections among hidden layer neurons, to sparsify the solution. Increasing the g-bar(inh.) parameter results in stronger inhibition and less redundancy in the hidden layer. There are some difficulty settings that increase the amount of overlap between the generative patterns, and it can be seen that a single-layer network struggles to deal with that overlap.