This module contains additional code that I used from outside in support of this. These are typically outside of the neural network, but used in filter visualization and similar.
A method that returns random numbers for Xavier initialization.
- shape – shape of the initializer.
- name – Name for the scope of the initializer
random numbers from tensorflow random_normal
This method reshapes (NHWC) 4D bock to (HWCN) 4D block
Parameters: nhwc – 4D block in (NHWC) format Returns: 4D block in (HWCN) format Return type: tensorflow tensor
This method reshapes (NHWC) 4D bock to (HWNC) 4D block
Parameters: nhwc – 4D block in (NHWC) format Returns: 4D block in (HWNC) format Return type: tensorflow tensor
This method is a wrapper to
put_kernels_on_grid. This adds the grid to image summaries.
Parameters: tensor (tensorflow) – A 4D block in (HWNC) format.
visualize_images(images, name='images', num_images=6)¶
This method sets up summaries for images.
- images – a 4D block in (NHWC) format.
- num_images – Number of images to display
I want this to display images in a grid rather than just display using tensorboard’s ugly system. This method should be a wrapper that converts images in (NHWC) format to (HWNC) format and makes a grid of the images.
Perhaps a code like this: