Closed crazzle closed 6 years ago
I have tested the pull request and I encountered a numpy error: ValueError: Input must be >= 2-d.
In reshape(img) the initial image is shaped as (784,) not (28,28). The return is also expected as (784,).
This process could be streamlined to avoid multiple reshapes by reshaping when the data is loaded into memory.
I will merge this if you can resolve the error in reshape() or optimize the reshapes so an operation like this can occur.
You are right, it is working now. As proposed I reshape the data in the beginning to (max_, height, width, 1). Also renamed reshape to rotate to differentiate from np.reshape :)
Thanks for the optimization @crazzle. On my machine, the preprocessing now takes 17.44 sec compared to the previous 112.72 sec.
Great suggestion!
You are welcome :)!
Transposing images is faster when using numpy.fliplr + rot90