Releases: brainpy/BrainPy
Releases · brainpy/BrainPy
Version 2.2.0
This release has provided important improvements for BrainPy, including usability, speed, functions, and others.
Backwards Incompatible changes
brainpy.nnmodule is no longer supported and has been removed since version 2.2.0. Instead, users should usebrainpy.trainmodule for the training of BP algorithms, online learning, or offline learning algorithms, andbrainpy.algorithmsmodule for online / offline training algorithms.- The
update()function for the model definition has been changed:
>>> # 2.1.x
>>>
>>> import brainpy as bp
>>>
>>> class SomeModel(bp.dyn.DynamicalSystem):
>>> def __init__(self, ):
>>> ......
>>> def update(self, t, dt):
>>> pass>>> # 2.2.x
>>>
>>> import brainpy as bp
>>>
>>> class SomeModel(bp.dyn.DynamicalSystem):
>>> def __init__(self, ):
>>> ......
>>> def update(self, tdi):
>>> t, dt = tdi.t, tdi.dt
>>> passwhere tdi can be defined with other names, like sha, to represent the shared argument across modules.
Deprecations
brainpy.dyn.xxx (neurons)andbrainpy.dyn.xxx (synapse)are no longer supported. Please usebrainpy.neurons,brainpy.synapsesmodules.brainpy.running.monitorhas been removed.brainpy.nnmodule has been removed.
New features
brainpy.math.Variablereceives abatch_axissetting to represent the batch axis of the data.
>>> import brainpy.math as bm
>>> a = bm.Variable(bm.zeros((1, 4, 5)), batch_axis=0)
>>> a.value = bm.zeros((2, 4, 5)) # success
>>> a.value = bm.zeros((1, 2, 5)) # failed
MathError: The shape of the original data is (2, 4, 5), while we got (1, 2, 5) with batch_axis=0.brainpy.trainprovidesbrainpy.train.BPTTfor back-propagation algorithms,brainpy.train.Onlinetrainerfor online training algorithms,brainpy.train.OfflineTrainerfor offline training algorithms.brainpy.Baseclass supports_excluded_varssetting to ignore variables when retrieving variables by usingBase.vars()method.
>>> class OurModel(bp.Base):
>>> _excluded_vars = ('a', 'b')
>>> def __init__(self):
>>> super(OurModel, self).__init__()
>>> self.a = bm.Variable(bm.zeros(10))
>>> self.b = bm.Variable(bm.ones(20))
>>> self.c = bm.Variable(bm.random.random(10))
>>>
>>> model = OurModel()
>>> model.vars().keys()
dict_keys(['OurModel0.c'])brainpy.analysis.SlowPointFindersupports directly analyzing an instance ofbrainpy.dyn.DynamicalSystem.
>>> hh = bp.neurons.HH(1)
>>> finder = bp.analysis.SlowPointFinder(hh, target_vars={'V': hh.V, 'm': hh.m, 'h': hh.h, 'n': hh.n})brainpy.datasetssupports MNIST, FashionMNIST, and other datasets.- Supports defining conductance-based neuron models``.
>>> class HH(bp.dyn.CondNeuGroup):
>>> def __init__(self, size):
>>> super(HH, self).__init__(size)
>>>
>>> self.INa = channels.INa_HH1952(size, )
>>> self.IK = channels.IK_HH1952(size, )
>>> self.IL = channels.IL(size, E=-54.387, g_max=0.03)brainpy.layersmodule provides commonly used models for DNN and reservoir computing.- Support composable definition of synaptic models by using
TwoEndConn,SynOut,SynSTPandSynLTP.
>>> bp.synapses.Exponential(self.E, self.E, bp.conn.FixedProb(prob),
>>> g_max=0.03 / scale, tau=5,
>>> output=bp.synouts.COBA(E=0.),
>>> stp=bp.synplast.STD())- Provide commonly used surrogate gradient function for spiking generation, including
brainpy.math.spike_with_sigmoid_gradbrainpy.math.spike_with_linear_gradbrainpy.math.spike_with_gaussian_gradbrainpy.math.spike_with_mg_grad
- Provide shortcuts for GPU memory management via
brainpy.math.disable_gpu_memory_preallocation(), andbrainpy.math.clear_buffer_memory().
What's Changed
- fix #207: synapses update first, then neurons, finally delay variables by @chaoming0625 in #219
- docs: add logos by @ztqakita in #218
- Add the biological NMDA model by @c-xy17 in #221
- docs: fix mathjax problem by @ztqakita in #222
- Add the parameter R to the LIF model by @c-xy17 in #224
- new version of brainpy: V2.2.0-rc1 by @chaoming0625 in #226
- update training apis by @chaoming0625 in #227
- Update quickstart and the analysis module by @c-xy17 in #229
- Eseential updates for montors, analysis, losses, and examples by @chaoming0625 in #230
- add numpy op tests by @ztqakita in #231
- Integrated simulation, simulaton and analysis by @chaoming0625 in #232
- update docs by @chaoming0625 in #233
- unify
brainpy.layerswith other modules inbrainpy.dynby @chaoming0625 in #234 - fix bugs by @chaoming0625 in #235
- update apis, docs, examples and others by @chaoming0625 in #236
- fixes by @chaoming0625 in #237
- fix: add dtype promotion = standard by @ztqakita in #239
- updates by @chaoming0625 in #240
- update training docs by @chaoming0625 in #241
- change doc path/organization by @chaoming0625 in #242
- Update advanced docs by @chaoming0625 in #243
- update quickstart docs & enable jit error checking by @chaoming0625 in #244
- update apis and examples by @chaoming0625 in #245
- update apis and tests by @chaoming0625 in #246
- Docs update and bugs fixed by @ztqakita in #247
- version 2.2.0 by @chaoming0625 in #248
- add norm and pooling & fix bugs in operators by @ztqakita in #249
Full Changelog: V2.1.12...V2.2.0
Version 2.1.12
Highlights
This release is excellent. We have made important improvements.
- We provide dozens of random sampling in NumPy which are not supportted in JAX, such as
brainpy.math.random.bernoulli,
brainpy.math.random.lognormal,brainpy.math.random.binomial,brainpy.math.random.chisquare,brainpy.math.random.dirichlet,brainpy.math.random.geometric,brainpy.math.random.f,brainpy.math.random.hypergeometric,brainpy.math.random.logseries,brainpy.math.random.multinomial,brainpy.math.random.multivariate_normal,brainpy.math.random.negative_binomial,brainpy.math.random.noncentral_chisquare,brainpy.math.random.noncentral_f,brainpy.math.random.power,brainpy.math.random.rayleigh,brainpy.math.random.triangular,brainpy.math.random.vonmises,brainpy.math.random.wald,brainpy.math.random.weibull - make efficient checking on numerical values. Instead of direct
id_tap()checking which has large overhead, currentlybrainpy.tools.check_erro_in_jit()is highly efficient. - Fix
JaxArrayoperator errors onNone - improve oo-to-function transformation speeds
ioworks:.save_states()and.load_states()
What's Changed
- support dtype setting in array interchange functions by @chaoming0625 in #209
- fix #144: operations on None raise errors by @chaoming0625 in #210
- add tests and new functions for random sampling by @c-xy17 in #213
- feat: fix
iofor brainpy.Base by @chaoming0625 in #211 - update advanced tutorial documentation by @chaoming0625 in #212
- fix #149 (dozens of random samplings in NumPy) and fix JaxArray op errors by @chaoming0625 in #216
- feat: efficient checking on numerical values by @chaoming0625 in #217
Full Changelog: V2.1.11...V2.1.12
Version 2.1.11
What's Changed
- fix: cross-correlation bug by @ztqakita in #201
- update apis, test and docs of numpy ops by @chaoming0625 in #202
- docs: add sphinx_book_theme by @ztqakita in #203
- fix: add requirements-doc.txt by @ztqakita in #204
- update contro flow, integrators, operators, and docs by @chaoming0625 in #205
- improve oo-to-function transformation speed by @chaoming0625 in #208
Full Changelog: V2.1.10...V2.1.11
Version 2.1.9
What's Changed
- update control flow APIs and Docs by @chaoming0625 in #192
- doc: update docs of dynamics simulation by @chaoming0625 in #193
- fix #125: add channel models and two-compartment Pinsky-Rinzel model by @chaoming0625 in #194
- JIT errors do not change Variable values by @chaoming0625 in #195
- fix a bug in math.activations.py by @c-xy17 in #196
- Functionalinaty improvements by @chaoming0625 in #197
- update rate docs by @chaoming0625 in #198
- update brainpy.dyn doc by @chaoming0625 in #199
Full Changelog: V2.1.8...V2.1.9
Version 2.1.10
- Fix bugs on synapse delay
Full Changelog: V2.1.9...V2.1.10
Version 2.1.8
What's Changed
- Fix #120 by @chaoming0625 in #178
- feat: brainpy.Collector supports addition and subtraction by @chaoming0625 in #179
- feat: delay variables support "indices" and "reset()" function by @chaoming0625 in #180
- Support reset functions in neuron and synapse models by @chaoming0625 in #181
update()function on longer need_tand_dtby @chaoming0625 in #183- small updates by @chaoming0625 in #188
- feat: easier control flows with
brainpy.math.ifelseby @chaoming0625 in #189 - feat: update delay couplings of
DiffusiveCouplingandAdditiveCoupingby @chaoming0625 in #190 - update version and changelog by @chaoming0625 in #191
Full Changelog: V2.1.7...V2.1.8
Version 2.1.7
What's Changed
- synapse models support heterogeneuos weights by @chaoming0625 in #170
- more efficient synapse implementation by @chaoming0625 in #171
- fix input models in brainpy.dyn by @chaoming0625 in #172
- fix: np array astype by @ztqakita in #173
- update README: 'brain-py' to 'brainpy' by @chaoming0625 in #174
- fix: fix the updating rules in the STP model by @c-xy17 in #176
- Updates and fixes by @chaoming0625 in #177
Full Changelog: V2.1.5...V2.1.7
Version 2.1.5
What's Changed
brainpy.math.random.shuffleis numpy like by @chaoming0625 in #153- update LICENSE by @chaoming0625 in #155
- docs: add m1 warning by @ztqakita in #154
- compatible apis of 'brainpy.math' with those of 'jax.numpy' in most modules by @chaoming0625 in #156
- Important updates by @chaoming0625 in #157
- Updates by @chaoming0625 in #159
- Add LayerNorm, GroupNorm, and InstanceNorm as nn_nodes in normalization.py by @c-xy17 in #162
- feat: add conv & pooling nodes by @ztqakita in #161
- fix: update setup.py by @ztqakita in #163
- update setup.py by @chaoming0625 in #165
- fix: change trigger condition by @ztqakita in #166
- fix: add build_conn() function by @ztqakita in #164
- update synapses by @chaoming0625 in #167
- get the deserved name: brainpy by @chaoming0625 in #168
- update tests by @chaoming0625 in #169
Full Changelog: V2.1.4...V2.1.5
Version 2.1.4
What's Changed
- fix doc parsing bug by @chaoming0625 in #127
- Update overview_of_dynamic_model.ipynb by @c-xy17 in #129
- Reorganization of
brainpylib.custom_opand adding interface inbrainpy.mathby @ztqakita in #128 - Fix: modify
register_opand brainpy.math interface by @ztqakita in #130 - new features about RNN training and delay differential equations by @chaoming0625 in #132
- Fix #123: Add low-level operators docs and modify register_op by @ztqakita in #134
- feat: add generate_changelog by @ztqakita in #135
- fix #133, support batch size training with offline algorithms by @chaoming0625 in #136
- fix #84: support online training algorithms by @chaoming0625 in #137
- feat: add the batch normalization node by @c-xy17 in #138
- fix: fix shape checking error by @chaoming0625 in #139
- solve #131, support efficient synaptic computation for special connection types by @chaoming0625 in #140
- feat: update the API and test for batch normalization by @c-xy17 in #142
- Node is default trainable by @chaoming0625 in #143
- Updates training apis and docs by @chaoming0625 in #145
- fix: add dependencies and update version by @ztqakita in #147
- update requirements by @chaoming0625 in #146
- data pass of the Node is default SingleData by @chaoming0625 in #148
Full Changelog: V2.1.3...V2.1.4
Version 2.1.3
This release improves the functionality and usability of BrainPy. Core changes include
- support customization of low-level operators by using Numba
- fix bugs
What's Changed
- Provide custom operators written in numba for jax jit by @ztqakita in #122
- fix DOGDecay bugs; add more features by @chaoming0625 in #124
- fix bugs by @chaoming0625 in #126
Full Changelog: V2.1.2...V2.1.3