-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue with first spike passing through adaptive synapse #3384
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,8 +89,8 @@ | |
############################################################################### | ||
# Now we assign the parameter set to the synapse models. | ||
|
||
tsodyks_params = dict(fac_params, synapse_model="tsodyks_synapse") # for tsodyks_synapse | ||
tsodyks2_params = dict(fac_params, synapse_model="tsodyks2_synapse") # for tsodyks2_synapse | ||
tsodyks_params = dict(dep_params, synapse_model="tsodyks_synapse") # for tsodyks_synapse | ||
tsodyks2_params = dict(dep_params, synapse_model="tsodyks2_synapse") # for tsodyks2_synapse | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I find it strange that both dep and fac parameters are given above, but only one of the sets is used, without any further explanation. It is also not clear to me why the default is now changed from fac to dep. Wouldn't it be most illustrative to show the effect of both facilitation and depression by creating a network with in total four plastic synapses? |
||
|
||
############################################################################### | ||
# Create three neurons. | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -121,7 +121,7 @@ def reproduce_weight_drift(self, _pre_spikes, absolute_weight=1.0): | |||||||||||||||||
n_steps = 1 + int(np.ceil(self.simulation_duration / self.resolution)) | ||||||||||||||||||
w_log = [] | ||||||||||||||||||
|
||||||||||||||||||
t_lastspike = 0.0 | ||||||||||||||||||
t_lastspike = -1.0 | ||||||||||||||||||
R_ = 1.0 # fraction of synaptic resources available for transmission in the range [0..1] | ||||||||||||||||||
u_ = self.synapse_parameters["U"] | ||||||||||||||||||
for time_in_simulation_steps in range(n_steps): | ||||||||||||||||||
|
@@ -130,20 +130,21 @@ def reproduce_weight_drift(self, _pre_spikes, absolute_weight=1.0): | |||||||||||||||||
# Adjusting the current time to make it exact. | ||||||||||||||||||
t_spike = _pre_spikes[pre_spikes_forced_to_grid.index(time_in_simulation_steps)] | ||||||||||||||||||
|
||||||||||||||||||
# Evaluating the depression rule. | ||||||||||||||||||
h = t_spike - t_lastspike | ||||||||||||||||||
R_decay = np.exp(-h / self.synapse_parameters["tau_rec"]) | ||||||||||||||||||
if self.synapse_parameters["tau_fac"] < 1e-10: | ||||||||||||||||||
u_decay = 0.0 | ||||||||||||||||||
else: | ||||||||||||||||||
u_decay = np.exp(-h / self.synapse_parameters["tau_fac"]) | ||||||||||||||||||
if t_lastspike >= 0.0: | ||||||||||||||||||
# Evaluating the depression rule. | ||||||||||||||||||
h = t_spike - t_lastspike | ||||||||||||||||||
R_decay = np.exp(-h / self.synapse_parameters["tau_rec"]) | ||||||||||||||||||
if self.synapse_parameters["tau_fac"] < 1e-10: | ||||||||||||||||||
u_decay = 0.0 | ||||||||||||||||||
else: | ||||||||||||||||||
u_decay = np.exp(-h / self.synapse_parameters["tau_fac"]) | ||||||||||||||||||
Comment on lines
+137
to
+140
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on the comment in the C++ code above, I would suggest here
Suggested change
Do we actually test for both cases, i.e. tau_fac == 0 and tau_fac != 0? |
||||||||||||||||||
|
||||||||||||||||||
R_ = 1.0 + (R_ - R_ * u_ - 1.0) * R_decay | ||||||||||||||||||
u_ = self.synapse_parameters["U"] + u_ * (1.0 - self.synapse_parameters["U"]) * u_decay | ||||||||||||||||||
|
||||||||||||||||||
w = R_ * u_ * absolute_weight | ||||||||||||||||||
w_log.append(w) | ||||||||||||||||||
|
||||||||||||||||||
R_ = 1.0 + (R_ - R_ * u_ - 1.0) * R_decay | ||||||||||||||||||
u_ = self.synapse_parameters["U"] + u_ * (1.0 - self.synapse_parameters["U"]) * u_decay | ||||||||||||||||||
|
||||||||||||||||||
t_lastspike = t_spike | ||||||||||||||||||
|
||||||||||||||||||
return w_log | ||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this check here a bit confusing. Since
tau_fac_ == 0
is allowed to turn off facilitation (actually the default), I think it is most sensible to actually test for zero.