neon.visualizations.data

Functions

convert_rgb_to_bokehrgba(img_data[, downsample]) Convert RGB image to two-dimensional array of RGBA values (encoded as 32-bit integers) (required by Bokeh).
create_epoch_x(points, epoch_freq, …) Helper function to build x axis for points captured per epoch.
create_minibatch_x(minibatches, …) Helper function to build x axis for data captured per minibatch.
h5_cost_data(filename[, epoch_axis]) Read cost data from hdf5 file.
h5_deconv_data(filename) Read deconv visualization data from hdf5 file.
h5_hist_data(filename[, epoch_axis]) Read histogram data from hdf5 file.
neon.visualizations.data.convert_rgb_to_bokehrgba(img_data, downsample=1)[source]

Convert RGB image to two-dimensional array of RGBA values (encoded as 32-bit integers) (required by Bokeh). The functionality is currently not available in Bokeh. An issue was raised here: https://github.com/bokeh/bokeh/issues/1699 and this function is a modified version of the suggested solution.

Parameters:
  • img_data – img (ndarray, shape: [N, M, 3], dtype: uint8): image data
  • dh – height of image
  • dw – width of image
Returns:

2D image array of RGBA values

Return type:

img (ndarray)

neon.visualizations.data.create_epoch_x(points, epoch_freq, minibatch_markers, epoch_axis)[source]

Helper function to build x axis for points captured per epoch.

Parameters:
  • points (int) – how many data points need a corresponding x axis points
  • epoch_freq (int) – are points once an epoch or once every n epochs?
  • minibatch_markers (int array) – cumulative number of minibatches complete at a given epoch
  • epoch_axis (bool) – whether to render epoch or minibatch as the integer step in the x axis
neon.visualizations.data.create_minibatch_x(minibatches, minibatch_markers, epoch_axis)[source]

Helper function to build x axis for data captured per minibatch.

Parameters:
  • minibatches (int) – how many total minibatches
  • minibatch_markers (int array) – cumulative number of minibatches complete at a given epoch
  • epoch_axis (bool) – whether to render epoch or minibatch as the integer step in the x axis
neon.visualizations.data.h5_cost_data(filename, epoch_axis=True)[source]

Read cost data from hdf5 file. Generate x axis data for each cost line.

Parameters:
  • filename (str) – Filename with hdf5 cost data
  • epoch_axis (bool) – whether to render epoch or minibatch as the integer step in the x axis
Returns:

list of tuples of (name, x data, y data)

neon.visualizations.data.h5_deconv_data(filename)[source]

Read deconv visualization data from hdf5 file.

Parameters:filename (str) – Filename with hdf5 deconv data
Returns:list of lists. Each inner list represents one layer, and consists of tuples (fm, deconv_data)
neon.visualizations.data.h5_hist_data(filename, epoch_axis=True)[source]

Read histogram data from hdf5 file. Generate x axis data for each hist line.

Parameters:
  • filename (str) – Filename with hdf5 cost data
  • epoch_axis (bool) – whether to render epoch or minibatch as the integer step in the x axis
Returns:

list of tuples of (name, data, dh, dw, bins, offset)