Algorithm 1
From: Probabilistic metaplasticity for continual learning with memristors in spiking networks

Probabilistic metaplasticity with error threshold-based eRBP for continual learning in a spiking network. \(\mathcal {T}\) denotes a set of sequential tasks. \(S^{\text {in}}\) and \(S^{\text {out}}\) are the input and output spike trains and W denotes weights realized with memristors. U is the error accumulated at the dendritic compartment of neurons. When |U| crosses the error threshold \(U_{\text {th}}\), the update probability \(p_{\text {update}}\) of eligible weights are calculated and compared with a random number to decide which weights should be updated. The memristor weights selected for update are programmed to the next higher or lower conductance level depending on the sign of the error. The function Program() refers to the operations required to update a memristor’s conductance. Details of the eRBP algorithm can be found in Methods.