trw.callbacks.callback_export_convolution_kernel

Module Contents

Classes

CallbackExportConvolutionKernel

Simply export convolutional kernel.

Functions

default_export_filter(filter, path, min_value=-0.05, max_value=0.05)

Default export of the filter. If interpretable as a 2D image, export a .png, else export a .npy array

Attributes

logger

trw.callbacks.callback_export_convolution_kernel.logger
trw.callbacks.callback_export_convolution_kernel.default_export_filter(filter, path, min_value=- 0.05, max_value=0.05)

Default export of the filter. If interpretable as a 2D image, export a .png, else export a .npy array

Parameters
  • filter – a filter

  • path – where export

  • min_value – clipping min value of a filter. If None, no clipping

  • max_value – clipping max value of a filter. If None, no clipping

Returns

None

class trw.callbacks.callback_export_convolution_kernel.CallbackExportConvolutionKernel(export_frequency=500, dirname='convolution_kernels', find_convolution_fn=graph_reflection.find_first_forward_convolution, dataset_name=None, split_name=None, export_filter_fn=default_export_filter)

Bases: trw.callbacks.callback.Callback

Simply export convolutional kernel.

This can be useful to check over the time if the weights have converger.

first_time(self, options, datasets, model)
__call__(self, options, history, model, losses, outputs, datasets, datasets_infos, callbacks_per_batch, **kwargs)