Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arbor
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor 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
arbor-sim
arbor
Commits
fe297d91
Unverified
Commit
fe297d91
authored
Mar 22, 2022
by
Sebastian Schmitt
Committed by
GitHub
Mar 22, 2022
Browse files
Options
Downloads
Patches
Plain Diff
List comprehension to speed up brunel python example (#1864)
parent
938d9da2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/example/brunel.py
+9
-4
9 additions, 4 deletions
python/example/brunel.py
with
9 additions
and
4 deletions
python/example/brunel.py
+
9
−
4
View file @
fe297d91
...
...
@@ -64,11 +64,16 @@ class brunel_recipe (arbor.recipe):
gen
=
RandomState
(
gid
+
self
.
seed_
)
connections
=
[]
# Add incoming excitatory connections.
for
i
in
sample_subset
(
gen
,
gid
,
0
,
self
.
ncells_exc_
,
self
.
in_degree_exc_
):
connections
.
append
(
arbor
.
connection
((
i
,
"
src
"
),
"
tgt
"
,
self
.
weight_exc_
,
self
.
delay_
))
connections
=
[
arbor
.
connection
((
i
,
"
src
"
),
"
tgt
"
,
self
.
weight_exc_
,
self
.
delay_
)
for
i
in
sample_subset
(
gen
,
gid
,
0
,
self
.
ncells_exc_
,
self
.
in_degree_exc_
)
]
# Add incoming inhibitory connections.
for
i
in
sample_subset
(
gen
,
gid
,
self
.
ncells_exc_
,
self
.
ncells_exc_
+
self
.
ncells_inh_
,
self
.
in_degree_inh_
):
connections
.
append
(
arbor
.
connection
((
i
,
"
src
"
),
"
tgt
"
,
self
.
weight_inh_
,
self
.
delay_
))
connections
+=
[
arbor
.
connection
((
i
,
"
src
"
),
"
tgt
"
,
self
.
weight_inh_
,
self
.
delay_
)
for
i
in
sample_subset
(
gen
,
gid
,
self
.
ncells_exc_
,
self
.
ncells_exc_
+
self
.
ncells_inh_
,
self
.
in_degree_inh_
)
]
return
connections
def
cell_description
(
self
,
gid
):
...
...
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