Marcel Stimberg
unread,Oct 16, 2019, 12:50:20 PM10/16/19Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to brian-de...@googlegroups.com
Hi Wilhelm,
in code strings, you can only use functions that we prepared for use
with Brian (since they get translated into C++ code, etc.). For random
numbers that means "rand()" for uniformly distributed, and "randn()" for
normally distributed numbers (Brian's development version also has
support for discrete numbers from a Poisson distribution). If that is
not enough, you can also generate numbers in Python and provide them as
values (instead of specifying the distribution as strings). This works
in principle both in runtime and standalone mode, but not in your case
where the number of synapses is random. In runtime mode you can do, say,
S.w = np.random.negative_binomial(1, 0.1, len(S))
but in standalone mode, "len(S)" will raise an error since the synapses
will only be generated as part of the standalone code, and we therefore
do not know yet how many values we need.
Best,
Marcel