PetaVision / OpenPV

PetaVision is a C++ library for designing and deploying large-scale neurally-inspired computational models.
http://petavision.github.io
Eclipse Public License 1.0
40 stars 13 forks source link

Fixed rare issue with sparse matrix dimensions #292

Closed haydn-jones closed 5 years ago

haydn-jones commented 5 years ago

Previously I was allowing the CSR sparse matrix constructor to infer the dimensions of the sparse matrix, which is generally not a problem. If the last n (n > 0) neurons in the LCA layer (when viewed as a flattened, 1D array) never activated throughout an entire run, the sparse matrix constructed would be missing the last n columns. The dimensions are only made wrong if a contiguous chunk at the very end of the flattened array didn't activate.

This commit doesn't change how the sparse values are being loaded in, or how the sparse matrix is being constructed. The problem has been fixed by always specifying the dimensions the matrix should have when constructing it.