Skip to main content
. 2024 Feb 29;12:RP84141. doi: 10.7554/eLife.84141
Algorithm 4 Learning and forgetting.
Parameters: gain γ, threshold θ, goal-learning rate α, forgetting rate δ
Input: adjacency matrix A, resource signals F
  M0                                                 initiate map synapses at 0
  G0                                                  initiate goal synapses at 0
  t0                                                          t counts the steps
  s(t)x start random walk at x
  while learning do
    tt+1
    s(t) a random neighbor of s(t1)                   continue the random walk
    ui(t)δi,s(t) for every point cell i                                point cell output
    v(t)(1γ1M)1u(t)                                        map cell output
    for all map cell pairs (i,j) do
      if vj(t1)>θ then                                        if pre-synaptic high
        if vi(t)>θ then                                     if post-synaptic also high
          Mij,Mji1                                      potentiate the synapses
        else                                                     if post-synaptic low
          MijeδMij                                       depress the synapses
          MjieδMji
        end if
      end if
    end for
    rGv(t)                                                          goal signals
    for every goal neuron k do
      DFk,s(t)rk difference between resource signal and prediction from the map
      if D>0 then          if the resource signal exceeds the prediction from the map
        for every map neuron j do
          GkjGkj+αDvj(t)                              potentiate goal synapses
        end for
      else                                      if resource signal less than prediction
        for every map neuron j do
          GkjeδvjGkj                                     depress goal synapses
        end for
      end if
    end for
  end while