Faster Alternatives to SciPy’s “.tocsc()” /u/Muted-Carrot-7879 Python Education

I have a program that is compressing a large matrix into a csc matrix and I was wondering if there are any faster alternatives out there. for context this is the code:

 R = sp.coo_array( (datas, (rows, cols)), shape=(self.n_actions, self.n_states) ) return R.tocsc() 

I’m trying to optimize a program and I feel like I can’t go any further without fixing this but I fear this is just how “.tocsc” will be.

things I have tried:

removing “.tocsc” – i’m using gurobi so it needs to take in a compressed matrix format

implementing CuPy and PyArma – this ran slower LMAO

any help would be helpful, thanks !!

submitted by /u/Muted-Carrot-7879
[link] [comments]

​r/learnpython I have a program that is compressing a large matrix into a csc matrix and I was wondering if there are any faster alternatives out there. for context this is the code: R = sp.coo_array( (datas, (rows, cols)), shape=(self.n_actions, self.n_states) ) return R.tocsc() I’m trying to optimize a program and I feel like I can’t go any further without fixing this but I fear this is just how “.tocsc” will be. things I have tried: removing “.tocsc” – i’m using gurobi so it needs to take in a compressed matrix format implementing CuPy and PyArma – this ran slower LMAO any help would be helpful, thanks !! submitted by /u/Muted-Carrot-7879 [link] [comments] 

I have a program that is compressing a large matrix into a csc matrix and I was wondering if there are any faster alternatives out there. for context this is the code:

 R = sp.coo_array( (datas, (rows, cols)), shape=(self.n_actions, self.n_states) ) return R.tocsc() 

I’m trying to optimize a program and I feel like I can’t go any further without fixing this but I fear this is just how “.tocsc” will be.

things I have tried:

removing “.tocsc” – i’m using gurobi so it needs to take in a compressed matrix format

implementing CuPy and PyArma – this ran slower LMAO

any help would be helpful, thanks !!

submitted by /u/Muted-Carrot-7879
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *