When the sparse matrix was being constructed, I was allowing the CSR matrix constructor to infer the dimensions of the matrix. This is not a problem if every neuron fired. In the event that the last n neurons (if the neurons are viewed as a flattened array) never activated throughout the whole run, the CSR constructor would not know that there should be n more columns in the sparse matrix (because there were no non-zero values in the final n columns indicating that those columns existed). This commit fixes that by always specifying what the dimensions of the sparse matrix should be.
This does not change anything about how the sparse values are being loaded or how the sparse matrix is being constructed, it's only ensuring that the the shape of the matrix is correct.
When the sparse matrix was being constructed, I was allowing the CSR matrix constructor to infer the dimensions of the matrix. This is not a problem if every neuron fired. In the event that the last n neurons (if the neurons are viewed as a flattened array) never activated throughout the whole run, the CSR constructor would not know that there should be n more columns in the sparse matrix (because there were no non-zero values in the final n columns indicating that those columns existed). This commit fixes that by always specifying what the dimensions of the sparse matrix should be.
This does not change anything about how the sparse values are being loaded or how the sparse matrix is being constructed, it's only ensuring that the the shape of the matrix is correct.