movehand / raisr

A Python implementation of RAISR
MIT License
553 stars 160 forks source link

The problem of runtime #20

Open Hill-Jiang opened 6 years ago

Hill-Jiang commented 6 years ago

@movehand Hello, can I ask you a question about the running speed of the program? GOOGLE says that the RAISR runtime is about 10^-2 to 10^-1 seconds. But I test it and the actual running time of a 512*512 medium sized image on the i7 processor was tens of seconds. Why the difference between the two running time is so huge?

movehand commented 6 years ago

I think it's simply the method of the actual implementation. This project is simply a rough guide of how RAISR works. So, without unrolling loop, parallelizing, etc. PyCUDA may be a nice option to speed things up!

BlauerHunger commented 6 years ago

It would probably help to get rid of the numpy arrays. Then it would be easy to parallelize the preprocessing on the cpu using multiprocessing.Pool.

bluewidy commented 6 years ago

@BlauerHunger How can I do that? Can you show me the parallel processing source code file?

BlauerHunger commented 6 years ago

Multiprocessing is explained here: https://docs.python.org/3/library/multiprocessing.html You can run a function over every element of a list in n processes running in parallel using Pool(n).map(function, list). Since the globals are copies and not shared, sharing data (such as the q and v) must be done either using returns (this might even be possible using the numpy arrays) or this way: https://docs.python.org/3/library/multiprocessing.html#sharing-state-between-processes

Additional efficiency could be gained by adding type information and compiling the project with cython.

excllent123 commented 6 years ago

@Shuaibishay Have you compared the result with A+? The result is bad compared with A+.and train takes a week in i7-8700 under div2k dateset.

hezc13 commented 6 years ago

@excllent123 Could you offer me your A+ code?I want to compare the results between the two algorithms.You can touch me with hezcChina@outlook.com

jtoy commented 5 years ago

any plans to get this working?