MCPcopy Create free account
hub / github.com/apache/singa / normalize

Function normalize

examples/cnn/data/cifar100.py:62–72  ·  view source on GitHub ↗
(train_x, val_x)

Source from the content-addressed store, hash-verified

60
61
62def normalize(train_x, val_x):
63 mean = [0.4914, 0.4822, 0.4465]
64 std = [0.2023, 0.1994, 0.2010]
65 train_x /= 255
66 val_x /= 255
67 for ch in range(0, 2):
68 train_x[:, ch, :, :] -= mean[ch]
69 train_x[:, ch, :, :] /= std[ch]
70 val_x[:, ch, :, :] -= mean[ch]
71 val_x[:, ch, :, :] /= std[ch]
72 return train_x, val_x
73
74
75def load():

Callers 1

loadFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected