Skip to content

Commit c6ee3e8

Browse files
committed
update changelog
1 parent 40187a8 commit c6ee3e8

File tree

1 file changed

+105
-0
lines changed

1 file changed

+105
-0
lines changed

changelog.rst

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,111 @@ tackling the shortcomings of brainpy 2.1.x generation,
1010
effectively bringing it to research needs and standards.
1111

1212

13+
14+
15+
Version 2.2.1 (2022.09.09)
16+
==========================
17+
18+
This release fixes bugs found in the codebase and improves the usability and functions of BrainPy.
19+
20+
Bug fixes
21+
~~~~~~~~~~~~~~
22+
23+
24+
#. Fix the bug of operator customization in ``brainpy.math.XLACustomOp`` and ``brainpy.math.register_op``. Now, it supports operator customization by using NumPy and Numba interface. For instance,
25+
26+
.. code-block:: python
27+
28+
import brainpy.math as bm
29+
30+
def abs_eval(events, indices, indptr, post_val, values):
31+
return post_val
32+
33+
def con_compute(outs, ins):
34+
post_val = outs
35+
events, indices, indptr, _, values = ins
36+
for i in range(events.size):
37+
if events[i]:
38+
for j in range(indptr[i], indptr[i + 1]):
39+
index = indices[j]
40+
old_value = post_val[index]
41+
post_val[index] = values + old_value
42+
43+
event_sum = bm.XLACustomOp(eval_shape=abs_eval, con_compute=con_compute)
44+
45+
46+
#. Fix the bug of ``brainpy.tools.DotDict``. Now, it is compatible with the transformations of JAX. For instance,
47+
48+
.. code-block:: python
49+
50+
import brainpy as bp
51+
from jax import vmap
52+
53+
@vmap
54+
def multiple_run(I):
55+
hh = bp.neurons.HH(1)
56+
runner = bp.dyn.DSRunner(hh, inputs=('input', I), numpy_mon_after_run=False)
57+
runner.run(100.)
58+
return runner.mon
59+
60+
mon = multiple_run(bp.math.arange(2, 10, 2))
61+
62+
New features
63+
~~~~~~~~~~~~~~
64+
65+
66+
#. Add numpy operators ``brainpy.math.mat``\ , ``brainpy.math.matrix``\ , ``brainpy.math.asmatrix``.
67+
#. Improve translation rules of brainpylib operators, improve its running speeds.
68+
#. Support ``DSView`` of ``DynamicalSystem`` instance. Now, it supports defining models with a slice view of a DS instance. For example,
69+
70+
.. code-block:: python
71+
72+
import brainpy as bp
73+
import brainpy.math as bm
74+
75+
76+
class EINet_V2(bp.dyn.Network):
77+
def __init__(self, scale=1.0, method='exp_auto'):
78+
super(EINet_V2, self).__init__()
79+
80+
# network size
81+
num_exc = int(3200 * scale)
82+
num_inh = int(800 * scale)
83+
84+
# neurons
85+
self.N = bp.neurons.LIF(num_exc + num_inh,
86+
V_rest=-60., V_th=-50., V_reset=-60., tau=20., tau_ref=5.,
87+
method=method, V_initializer=bp.initialize.Normal(-55., 2.))
88+
89+
# synapses
90+
we = 0.6 / scale # excitatory synaptic weight (voltage)
91+
wi = 6.7 / scale # inhibitory synaptic weight
92+
self.Esyn = bp.synapses.Exponential(pre=self.N[:num_exc], post=self.N,
93+
conn=bp.connect.FixedProb(0.02),
94+
g_max=we, tau=5.,
95+
output=bp.synouts.COBA(E=0.),
96+
method=method)
97+
self.Isyn = bp.synapses.Exponential(pre=self.N[num_exc:], post=self.N,
98+
conn=bp.connect.FixedProb(0.02),
99+
g_max=wi, tau=10.,
100+
output=bp.synouts.COBA(E=-80.),
101+
method=method)
102+
103+
net = EINet_V2(scale=1., method='exp_auto')
104+
# simulation
105+
runner = bp.dyn.DSRunner(
106+
net,
107+
monitors={'spikes': net.N.spike},
108+
inputs=[(net.N.input, 20.)]
109+
)
110+
runner.run(100.)
111+
112+
# visualization
113+
bp.visualize.raster_plot(runner.mon.ts, runner.mon['spikes'], show=True)
114+
115+
116+
117+
13118
Version 2.2.0 (2022.08.12)
14119
==========================
15120

0 commit comments

Comments
 (0)