(X, (nh, nw), save_path=None)
| 2 | from scipy.misc import imsave |
| 3 | |
| 4 | def grayscale_grid_vis(X, (nh, nw), save_path=None): |
| 5 | h, w = X[0].shape[:2] |
| 6 | img = np.zeros((h*nh, w*nw)) |
| 7 | for n, x in enumerate(X): |
| 8 | j = n/nw |
| 9 | i = n%nw |
| 10 | img[j*h:j*h+h, i*w:i*w+w] = x |
| 11 | if save_path is not None: |
| 12 | imsave(save_path, img) |
| 13 | return img |
| 14 | |
| 15 | def color_grid_vis(X, (nh, nw), save_path=None): |
| 16 | h, w = X[0].shape[:2] |
no outgoing calls
no test coverage detected