We are happy to announce the Brian 2.8 release . This release fixes a number of small bugs and improves our release infrastructure. In addition, it includes an important performance improvement for random number generation in C++ standalone mode, which significantly speeds up everything that needs randomness (e.g. PoissonGroup
). It also comes with the Diehl & Cook (2015) model in the documentation, contributed by @bjourne (thanks!).
Brian 2 can be installed with pip from the pypi repository , and via several other means (some of them might take a while to catch up to the latest release). See the installation instructions , and the badges in the README file for more details.
Thanks to everyone who contributed !
2 Likes
Hi @mstimberg , regarding to the following new feature:
" delete
has a new option to delete arrays stored on disk for the run_args
feature – this can be useful for training paradigms, where the run_args
are used to provide a large array of weights from a previous run"
Is this intended to solve the problem of large number of files in cpp_standalone mode when running with run_args with many samples?
In the older verion, I invoke the delete command at the very end when the entire simulation is done. Does it mean we need to use the command within the run_arg loop to leverage this new feature , e.g. as the following?
for tau_value in (np.arange(10)+1)*5*ms:
device.run(run_args={group.tau: tau_value})
device.detele(force=True)
Hi @DavidKing2020. Even before introducing this feature, you could have deleted everything except for the code after every run with device.delete(code=False, directory=False)
. Previously, this would have leave arrays used for the run_args
features on the disk. In your example above, this is not an issue, since tau_value
is a single value and never written to disk. But if you use something like
old_weights = initial_weights
for input_stimulus in stimuli:
device.run(input_neurons.rates: input_stimulus, synapses.w: old_weights)
old_weights = synapses.w[:] # store previous weights
then input_neurons.rates
and synapses.w
would be initialized via arrays from disk at every iteration. These arrays would have been previously kept around, except if you did force=True
. But forcing the full deletion of the output directory is not something you’d want before the very end of all your simulations – if will delete the compiled code as well, and you’d have to run device.build
again before you can do a device.run
. With the latest version, you can now add device.delete(code=False, directory=False)
to the end of the loop body (after extracting all the values you are interested in) and it will prevent that the disk space used by the output directory increases with every run.
Hope that makes things a bit clearer?
1 Like
Thanks @mstimberg . That’s quite clear!