Scales all values in the ndarray ndar to be between 0 and 1
(ndar, eps=1e-8)
| 10 | |
| 11 | |
| 12 | def scale_to_unit_interval(ndar, eps=1e-8): |
| 13 | """ Scales all values in the ndarray ndar to be between 0 and 1 """ |
| 14 | ndar = ndar.copy() |
| 15 | ndar -= ndar.min() |
| 16 | ndar *= 1.0 / (ndar.max() + eps) |
| 17 | return ndar |
| 18 | |
| 19 | |
| 20 | def tile_raster_images(X, img_shape, tile_shape, tile_spacing=(0, 0), |
no outgoing calls
no test coverage detected