Skip to content
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

Port delay re-draw fix #10

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Potjans_2014/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,10 @@ def __connect_neuronal_populations(self):
std=(
self.net_dict['delay_matrix_mean'][i][j] *
self.net_dict['delay_rel_std'])),
min=self.sim_resolution,
# resulting minimum delay is equal to resolution, see:
# https://nest-simulator.readthedocs.io/en/latest/nest_behavior
# /random_numbers.html#rounding-effects-when-randomizing-delays
min=nest.resolution - 0.5 * nest.resolution,
max=np.Inf)}
elif self.nest_version == '2':
syn_dict = {
Expand Down Expand Up @@ -774,7 +777,10 @@ def __connect_thalamic_stim_input(self):
std=(
self.stim_dict['delay_th_mean'] *
self.stim_dict['delay_th_rel_std'])),
min=self.sim_resolution,
# resulting minimum delay is equal to resolution, see:
# https://nest-simulator.readthedocs.io/en/latest/nest_behavior
# /random_numbers.html#rounding-effects-when-randomizing-delays
min=nest.resolution - 0.5 * nest.resolution,
max=np.Inf)}

elif self.nest_version == '2':
Expand Down
9 changes: 6 additions & 3 deletions Potjans_2014/network_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,13 @@ def get_exc_inh_matrix(val_exc, val_inh, num_pops):
# mean rates of the different populations in the non-scaled version of the
# microcircuit (in spikes/s; same order as in 'populations');
# necessary for the scaling of the network.
# The values were optained by running this PyNEST microcircuit with 12 MPI
# processes and both 'N_scaling' and 'K_scaling' set to 1.
# The values were obtained by running this PyNEST microcircuit without MPI,
# 'local_num_threads' 4 and both 'N_scaling' and 'K_scaling' set to 1.
#
# Since these rates were only taken from one simulation, they alone are not sufficient for verification.
# For that, rates should be compared to mean values over multiple runs with different RNG seeds.
'full_mean_rates':
np.array([0.943, 3.026, 4.368, 5.882, 7.733, 8.664, 1.096, 7.851]),
np.array([0.903, 2.965, 4.414, 5.876, 7.569, 8.633, 1.105, 7.829]),
# connection probabilities (the first index corresponds to the targets
# and the second to the sources)
'conn_probs':
Expand Down
3 changes: 2 additions & 1 deletion multi-area-model/multiarea_model/simulation_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,7 @@ def connect(simulation,
s = network.distances[target_area.name][source_area.name]
mean_delay = s / v

dt = simulation.params['dt']
syn_spec = {
'synapse_model': 'static_synapse',
'weight': nest.math.redraw(
Expand All @@ -671,7 +672,7 @@ def connect(simulation,
mean=mean_delay,
std=mean_delay * network.params['delay_params']['delay_rel']
),
min=simulation.params['dt'],
min=dt - 0.5 * dt,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only works if dt=nest.resolution. Subtract nest.resolution instead of dt.

max=np.Inf)}

nest.Connect(source_area.gids[source],
Expand Down