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

Function flatten

cnn_class/benchmark.py:24–31  ·  view source on GitHub ↗
(X)

Source from the content-addressed store, hash-verified

22
23
24def flatten(X):
25 # input will be (32, 32, 3, N)
26 # output will be (N, 3072)
27 N = X.shape[-1]
28 flat = np.zeros((N, 3072))
29 for i in range(N):
30 flat[i] = X[:,:,:,i].reshape(3072)
31 return flat
32
33# In [6]: train['X'].shape
34# Out[6]: (32, 32, 3, 73257)

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected