Skip to content
Aykut G. Gelen edited this page May 29, 2022 · 9 revisions

Spike-Timing-Dependent Plasticity

You can now create a STDP curve in the Spayk.

from spayk.Synapses import STDP

stdp_prototype = STDP(A_plus=0.008, A_minus=0.008*1.10, tau_stdp=20.0)
time_diff = np.linspace(-5 * tau_stdp, 5 * tau_stdp, 50)
dW = stdp_prototype.calculate_dW(time_diff)

spayk_STDP_currve

The conductance changes and membrane potentials for selected neurons are shown in the STDP demo for the scenario where 300 pre-synaptic neurons are connected to 1 post-synaptic neuron.

from spayk.Generators import PoissonSpikeGenerator
from spayk.Visualization import raster_plot, plot_voltage_traces

from spayk.Synapses import STDP

pg = PoissonSpikeGenerator(dt=0.1)
presyn_spike_trains = pg.generate(t_end=1000, no_neurons=300, firing_rate=10)
raster_plot(presyn_spike_trains, dt=0.1)

stdp0 = STDP(A_plus=0.008, A_minus=0.008*1.10, tau_stdp=20)
LTPs = stdp0.calculate_LTP(presyn_spike_trains, dt=0.1)
plot_voltage_traces(LTPs, selected=[1,3,5,7,9])

v, post_syn_spike_train, gE, LTP, LTD, d_gE = stdp0.update_weights(presyn_spike_trains, dt=0.1)
plot_voltage_traces(np.array([v, gE, LTD]))

plot_voltage_traces(d_gE, selected=[1,3,5,7,9])

Membrane Potentials

spayk_stdp_membrane_voltages

Long Term Potentiation Model

spayk_stdp_ltp

Change in Synaptic Weights

spayk_stdp_dw

Wiki

Neuron Dynamics

Learning

Clone this wiki locally