MCPcopy Index your code
hub / github.com/lisa-lab/DeepLearningTutorials / scale_to_unit_interval

Function scale_to_unit_interval

code/utils.py:12–17  ·  view source on GitHub ↗

Scales all values in the ndarray ndar to be between 0 and 1

(ndar, eps=1e-8)

Source from the content-addressed store, hash-verified

10
11
12def 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
20def tile_raster_images(X, img_shape, tile_shape, tile_spacing=(0, 0),

Callers 1

tile_raster_imagesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected