def stdp2rbp_non_linear_calcium(*args, **kwargs): """Rate-based plasticity from STDP using the non linear calcium model. Same arguments as ~cbsp.population_1.non_linear_calcium(u, v, w0, seed) Returns: float: the population average change of synapse strength at time point 0 """ w_rec, t, _ = non_linear_calcium(*args, **kwargs) return utils.derivative(w_rec.mean(axis=0), t)
def stdp2rbp_linear_calcium_mat(*args, **kwargs): """Rate-based plasticity from STDP using the linear calcium and MAT model. Args: - same as cbsp.population_3.linear_calcium_mat(u1, w1, u2, w2, seed) Returns: tuple: (w, v) with float: w, the population average change of synapse strength at time point 0 float: v, the postsynaptic firing rate within the first 500ms. """ (w_rec, _), t, (_, _, v_rec, _, _, _) = linear_calcium_mat(*args, **kwargs) return utils.derivative(w_rec.mean(axis=0), t), v_rec[0:int(0.5 / cbsp.TIMESTEP)].sum() * 2