Skip to main content
. 2018 Feb 27;12:105. doi: 10.3389/fnins.2018.00105

Algorithm 2.

Algorithmic implementation of three-factor STDP.

  function processRow(t)
      for all j in postSynapticNeurons do
           historygetHistoryEntries(j, told, t)
  (tprev, sprev, Dprev, typeprev) ← getPrecedingHistoryEntry(t)
  tctold
          DcDprevexp((tctprevτD)
          for all (tj, sj, Dj, typej) in history do
  wijwij+CijDc(1τC+1τD)(exp((tjtcτC)exp((tjtcτD)1)
          CijCijexp(-tj-tcτC)
          if typej is not dopamine then
           CijapplyPostSpike(Cij, tj, told, si)
    DcDj
    tctj
 
     (tj, sj, Dj, typej)←getLastHistoryEntry(t)
     wijwij+CijDc(1τC+1τD)(exp((ttcτC)exp((ttcτD)1)
     CijCijexp(-t-tcτC)
    CijapplyPreSpike(Cij, t, tj, sj)
     addWeightToRingBuffer(wij, j)
 
  siaddPreSpike(si, t, told)
  toldt