Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
multi-area-model
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IAS-6
multi-area-model
Commits
3635bac5
Commit
3635bac5
authored
Jan 19, 2022
by
jasperalbers
Browse files
Options
Downloads
Patches
Plain Diff
update to final NEST 3.0 syntax
parent
44d7357a
No related branches found
No related tags found
1 merge request
!19
Enable use of NEST 3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
multiarea_model/simulation.py
+68
-30
68 additions, 30 deletions
multiarea_model/simulation.py
with
68 additions
and
30 deletions
multiarea_model/simulation.py
+
68
−
30
View file @
3635bac5
...
@@ -622,6 +622,7 @@ def connect(simulation,
...
@@ -622,6 +622,7 @@ def connect(simulation,
source_area : Area instance
source_area : Area instance
Source area of the projection
Source area of the projection
"""
"""
network
=
simulation
.
network
network
=
simulation
.
network
synapses
=
extract_area_dict
(
network
.
synapses
,
synapses
=
extract_area_dict
(
network
.
synapses
,
network
.
structure
,
network
.
structure
,
...
@@ -635,6 +636,50 @@ def connect(simulation,
...
@@ -635,6 +636,50 @@ def connect(simulation,
network
.
structure
,
network
.
structure
,
target_area
.
name
,
target_area
.
name
,
source_area
.
name
)
source_area
.
name
)
if
network
.
params
[
'
USING_NEST_3
'
]:
for
target
in
target_area
.
populations
:
for
source
in
source_area
.
populations
:
conn_spec
=
{
'
rule
'
:
'
fixed_total_number
'
,
'
N
'
:
int
(
synapses
[
target
][
source
])}
if
target_area
==
source_area
:
if
'
E
'
in
source
:
w_min
=
0.
w_max
=
np
.
Inf
mean_delay
=
network
.
params
[
'
delay_params
'
][
'
delay_e
'
]
elif
'
I
'
in
source
:
w_min
=
np
.
NINF
w_max
=
0.
mean_delay
=
network
.
params
[
'
delay_params
'
][
'
delay_i
'
]
else
:
w_min
=
0.
w_max
=
np
.
Inf
v
=
network
.
params
[
'
delay_params
'
][
'
interarea_speed
'
]
s
=
network
.
distances
[
target_area
.
name
][
source_area
.
name
]
mean_delay
=
s
/
v
syn_spec
=
{
'
synapse_model
'
:
'
static_synapse
'
,
'
weight
'
:
nest
.
math
.
redraw
(
nest
.
random
.
normal
(
mean
=
W
[
target
][
source
],
std
=
W_sd
[
target
][
source
]),
min
=
w_min
,
max
=
w_max
),
'
delay
'
:
nest
.
math
.
redraw
(
nest
.
random
.
normal
(
mean
=
mean_delay
,
std
=
(
mean_delay
*
network
.
params
[
'
delay_params
'
][
'
delay_rel
'
])),
min
=
simulation
.
params
[
'
dt
'
],
max
=
np
.
Inf
)
}
nest
.
Connect
(
source_area
.
gids
[
source
],
target_area
.
gids
[
target
],
conn_spec
,
syn_spec
)
else
:
for
target
in
target_area
.
populations
:
for
target
in
target_area
.
populations
:
for
source
in
source_area
.
populations
:
for
source
in
source_area
.
populations
:
conn_spec
=
{
'
rule
'
:
'
fixed_total_number
'
,
conn_spec
=
{
'
rule
'
:
'
fixed_total_number
'
,
...
@@ -654,7 +699,6 @@ def connect(simulation,
...
@@ -654,7 +699,6 @@ def connect(simulation,
v
=
network
.
params
[
'
delay_params
'
][
'
interarea_speed
'
]
v
=
network
.
params
[
'
delay_params
'
][
'
interarea_speed
'
]
s
=
network
.
distances
[
target_area
.
name
][
source_area
.
name
]
s
=
network
.
distances
[
target_area
.
name
][
source_area
.
name
]
mean_delay
=
s
/
v
mean_delay
=
s
/
v
syn_delay
=
{
'
distribution
'
:
'
normal_clipped
'
,
syn_delay
=
{
'
distribution
'
:
'
normal_clipped
'
,
'
low
'
:
simulation
.
params
[
'
dt
'
],
'
low
'
:
simulation
.
params
[
'
dt
'
],
'
mu
'
:
mean_delay
,
'
mu
'
:
mean_delay
,
...
@@ -663,12 +707,6 @@ def connect(simulation,
...
@@ -663,12 +707,6 @@ def connect(simulation,
'
delay
'
:
syn_delay
,
'
delay
'
:
syn_delay
,
'
model
'
:
'
static_synapse
'
}
'
model
'
:
'
static_synapse
'
}
if
network
.
params
[
'
USING_NEST_3
'
]:
nest
.
Connect
(
source_area
.
gids
[
source
],
target_area
.
gids
[
target
],
conn_spec
,
syn_spec
)
else
:
nest
.
Connect
(
tuple
(
range
(
source_area
.
gids
[
source
][
0
],
nest
.
Connect
(
tuple
(
range
(
source_area
.
gids
[
source
][
0
],
source_area
.
gids
[
source
][
1
]
+
1
)),
source_area
.
gids
[
source
][
1
]
+
1
)),
tuple
(
range
(
target_area
.
gids
[
target
][
0
],
tuple
(
range
(
target_area
.
gids
[
target
][
0
],
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment