# Neural Models

Teaching material and code examples for neural network programming and parameter regression with artificial neural systems (in Matlab).

I usually run through the code several times before publishing it and especially the parts that have been used in a course/workshop have been commented, but do let me know if you find any bug or have any particular question. Please consider I am not a programmer, but a cognitive neuroscientist, so these examples do not represent the best possible practice for coding.

By the way, if you think there is a better way to code the same functions or if you simply want to share your code for neural networks, please feel free to comment!

## Minimal onset detector and parameter regression

The following code examples represent four distinct codes to solve in different ways the task of generating a small onset detector neural network, as portrayed in the figure below: An arbitrary input reaches two units performing a simple (identical) computation. The output unit (neuron 1) receives the excitatory input and, with a very short delay due to the …

## Mean field activity

In this case a layer of interconnected leaky neurons is characterised by a positive tanh as a transfer function. The time component is slower than the one we have in spiking neurons (the decay of the leaky is at least 100 times slower), as a consequence each of these slow units can be conceived as simulating the average activity …

## Spiking neurons, cluster example

Quick example to create a cluster of interconnected spiking neurons controlled by a leaky integrator for the action potential. A simple input is provided characterised by the same numerosity of the neural cluster. All parameters can be changes to see the effect of different types of connectivity on the overall activity. NB the simulation relies on …

## Layer of clusters with lateral inhibitions

Download the compressed folder to run the simulation in Matlab: zip_files. The main file “cluster_competition” calls several functions to build a structure of clusters and the relative connections. In a way this is the equivalent of the simulations presented in the mean field example, where this time we have a cluster of spiking neurons per each single unit simulating the mean field …

## Simple time series regression using genetic algorithms

It is not surprising that artificial neural networks have been primarily developed as a tool to approximate, estimate and forecast the evolution of time series in the future starting from a dataset describing the past. Indeed, a record of neural activity in a single neuron (spiking) or population (mean field) is just one of the many possible examples …

## Pattern raiders: regressions of complex time series

NB In this example I use most of the code and concepts already presented when explaining simple time series regressions using genetic algorithms. Please refer to that text for the basic explanations. In the previous example we were happy with the idea to get rid of many features in the target time series that were considered unimportant. …

## Basal Ganglia: package to simulate mean field neural dynamics

Very briefly, you can download here a Matlab code to simulate the neural activity in a single, 3-channel, cortico-striatal loop. The parameters used in this example have been hand tuned to replicate the dynamics described in Fiore et al. 2016,Changing pattern in the basal ganglia: motor switching under reduced dopaminergic drive.  http://www.nature.com/articles/srep23327 As a start, you can …

Insert math as
$${}$$