MCPcopy
hub / github.com/instillai/machine-learning-course / resize_batch

Function resize_batch

code/deep_learning/autoencoder/ae.py:16–26  ·  view source on GitHub ↗
(imgs)

Source from the content-addressed store, hash-verified

14
15
16def resize_batch(imgs):
17 # A function to resize a batch of MNIST images to (32, 32)
18 # Args:
19 # imgs: a numpy array of size [batch_size, 28 X 28].
20 # Returns:
21 # a numpy array of size [batch_size, 32, 32].
22 imgs = imgs.reshape((-1, 28, 28, 1))
23 resized_imgs = np.zeros((imgs.shape[0], 32, 32, 1))
24 for i in range(imgs.shape[0]):
25 resized_imgs[i, ..., 0] = transform.resize(imgs[i, ..., 0], (32, 32))
26 return resized_imgs
27
28
29def autoencoder(inputs):

Callers 1

ae.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected