OHDSI / bayes-bridge

Bayesian sparse regression with regularized shrinkage and conjugate gradient acceleration
https://bayes-bridge.readthedocs.io/en/latest/
19 stars 7 forks source link

Optimize matrix-vector multiplication for binary design matrix #3

Open chinandrew opened 3 years ago

chinandrew commented 3 years ago

Currently the matrix multiplication that occurs is a double times a double, but the first matrix is only 1/0 so it could be optimized. @aki-nishimura you mentioned you made an attempt at this, could you please link any relevant commits and notes?

aki-nishimura commented 3 years ago

Here is my old attempt --- it was the first Cython code I wrote though, so I am not sure if I did things right: https://github.com/aki-nishimura/bayes-bridge/blob/master/bayesbridge/design_matrix/cython_matmal/binary_matmul.pyx