This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import sqrt | |
def put_kernels_on_grid (kernel, pad = 1): | |
'''Visualize conv. filters as an image (mostly for the 1st layer). | |
Arranges filters into a grid, with some paddings between adjacent filters. | |
Args: | |
kernel: tensor of shape [Y, X, NumChannels, NumKernels] | |
pad: number of black pixels around each filter (between them) |