pmelchior / proxmin

Proximal optimization in pure python
MIT License
109 stars 23 forks source link

Remove zeros_like #11

Closed pmelchior closed 6 years ago

pmelchior commented 6 years ago

The numpy zeros_like function has an extra internal copy to allow initializing a character array to a string of zeros. This extra behavior can be costly, for example in scarlet 10% of the processing time was saved by switching from np.zeros_like(X) to np.zeros(X.shape dtype=X.dtype).

Also, this adds a test for the function/property spectral_norm in MatrixAdapter, which we need for scarlet.