def deconv_figs(layer_name, layer_data, fm_max=8, plot_size=120):
 vis_keys = dict()
 img_keys = dict()
 fig_dict = dict()
 for (fm_num, (fm_name, deconv_data, img_data)) in enumerate(layer_data):
  if (fm_num >= fm_max):
   break
  (img_h, img_w) = img_data.shape
  x_range = Range1d(start=0, end=img_w)
  y_range = Range1d(start=0, end=img_h)
  img_fig = image_fig(img_data, img_h, img_w, x_range, y_range, plot_size)
  deconv_fig = image_fig(deconv_data, img_h, img_w, x_range, y_range, plot_size)
  title = '{}_fmap_{:04d}'.format(layer_name, fm_num)
  vis_keys[fm_num] = ('vis_' + title)
  img_keys[fm_num] = ('img_' + title)
  fig_dict[vis_keys[fm_num]] = deconv_fig
  fig_dict[img_keys[fm_num]] = img_fig
 return (vis_keys, img_keys, fig_dict)

def deconv_figs ( layer_name , layer_data , fm_max = 8 , plot_size = 120 ) : vis_keys = dict ( ) img_keys = dict ( ) fig_dict = dict ( ) for ( fm_num , ( fm_name , deconv_data , img_data ) ) in enumerate ( layer_data ) : if ( fm_num >= fm_max ) : break ( img_h , img_w ) = img_data . shape x_range = Range1d ( start = 0 , end = img_w ) y_range = Range1d ( start = 0 , end = img_h ) img_fig = image_fig ( img_data , img_h , img_w , x_range , y_range , plot_size ) deconv_fig = image_fig ( deconv_data , img_h , img_w , x_range , y_range , plot_size ) title = '{}_fmap_{:04d}' . format ( layer_name , fm_num ) vis_keys [ fm_num ] = ( 'vis_' + title ) img_keys [ fm_num ] = ( 'img_' + title ) fig_dict [ vis_keys [ fm_num ] ] = deconv_fig fig_dict [ img_keys [ fm_num ] ] = img_fig return ( vis_keys , img_keys , fig_dict )
helper function to generate deconv visualization figures arguments: layer_name : layer name layer_data : layer data to plot fm_max : max layers to process plot_size : plot size returns: tuple if vis_keys .