MCPcopy Index your code
hub / github.com/lazyprogrammer/machine_learning_examples / rearrange

Function rearrange

cnn_class/cnn_theano.py:51–60  ·  view source on GitHub ↗
(X)

Source from the content-addressed store, hash-verified

49
50
51def rearrange(X):
52 # input is (32, 32, 3, N)
53 # output is (N, 3, 32, 32)
54 # N = X.shape[-1]
55 # out = np.zeros((N, 3, 32, 32), dtype=np.float32)
56 # for i in range(N):
57 # for j in range(3):
58 # out[i, j, :, :] = X[:, :, j, i]
59 # return out / 255
60 return (X.transpose(3, 2, 0, 1) / 255).astype(np.float32)
61
62
63def main():

Callers 2

mainFunction · 0.90
mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected