Skip to content

Version 2.2.3

Compare
Choose a tag to compare
@chaoming0625 chaoming0625 released this 04 Oct 11:22
· 1336 commits to master since this release
174c81a

This release continues to improve the usability of BrainPy.

New Features

  1. Operations among a JaxArray and a NumPy ndarray 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)
  1. 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)
  1. 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.

  1. 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

Full Changelog: V2.2.2...V2.2.3