brainpy / BrainPy

Brain Dynamics Programming in Python
https://brainpy.readthedocs.io/
GNU General Public License v3.0
491 stars 90 forks source link

[math] Optimize event csr matvec and matmat operators #675

Open Routhleck opened 1 month ago

Routhleck commented 1 month ago

Utilize event-driven computation for non-boolean matrix for the event csr matvec and matmat operator.

event matvec

https://github.com/brainpy/BrainPy/blob/bbb57e4922d93ce2a6fce16307d8aace28889fce/brainpy/_src/math/event/csr_matvec.py#L126-L147

event matmat

https://github.com/brainpy/BrainPy/blob/70b0cb97afc4239b5f34db3a40e8e5df518283c7/brainpy/_src/math/event/csr_matmat.py#L94-L109

Use Taichi kernels to optimize automatic differentiation of event csr matvec and matmat operator.

event matvec

https://github.com/brainpy/BrainPy/blob/2c5c24c285622301485e3e4da36330b46ecdca2f/brainpy/_src/math/event/csr_matmat.py#L236-L263

event matmat

https://github.com/brainpy/BrainPy/blob/2c5c24c285622301485e3e4da36330b46ecdca2f/brainpy/_src/math/event/csr_matvec.py#L450-L495