Version 2.2.3
This release continues to improve the usability of BrainPy.
New Features
- Operations among a
JaxArray
and a NumPyndarray
in a JIT function no longer cause errors.
>>> import numpy as np
>>> import brainpy.math as bm
>>> f = bm.jit(lambda: bm.random.random(3) + np.ones(1))
>>> f
JaxArray([1.2022058, 1.683937 , 1.3586301], dtype=float32)
- Initializing a
brainpy.math.Variable
according to the data shape.
>>> bm.Variable(10, dtype=bm.float32)
Variable([0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], dtype=float32)
LengthDelay
supports a new method called"concatenate"
which is compatible with BP training.
>>> delay = bm.LengthDelay(bm.ones(3), 10, update_method='concatenate')
>>> delay.update(bm.random.random(3))
>>> delay.retrieve(0)
DeviceArray([0.17887115, 0.6738142 , 0.75816643], dtype=float32)
>>> delay.retrieve(10)
DeviceArray([0., 0., 0.], dtype=float32)
Note that compared with the default updating method "rotation"
, this method can be used to train delay models with BP algorithms. However, "concatenate"
has a slower speed for delay processing.
- Support customizing the plotting styles of fixed points. However, there is still work to support flexible plotting of analyzed results.
>>> from brainpy.analysis import plotstyle, stability
>>> plotstyle.set_plot_schema(stability.SADDLE_NODE, marker='*', markersize=15)
Full Changelog: V2.2.2...V2.2.3
What's Changed
- Update installation info and delay apis by @chaoming0625 in #263
- Support initializing a Variable by data shape by @chaoming0625 in #265
- operations with JaxArray and numpy ndarray do not cause errors by @chaoming0625 in #266
- Update
VariableView
and analysis plotting apis by @chaoming0625 in #268
Full Changelog: V2.2.2...V2.2.3