neon.callbacks.callbacks.HistCallback

class neon.callbacks.callbacks.HistCallback(plot_per_mini, filter_key)[source]

Bases: neon.callbacks.callbacks.Callback

Collect histograms of weights of all layers. Configurable to computed histograms once per minibatch or once per epoch using the plot_per_mini flag. Histograms are stored to the hdf5 output file and can be visualized using the nvis tool.

__init__(plot_per_mini, filter_key)[source]

Methods

__init__(plot_per_mini, filter_key)
gen_class(pdict)
get_description() Serialize callback configuration.
on_epoch_begin(callback_data, model, epoch) Called when an epoch is about to begin
on_epoch_end(callback_data, model, epoch) Called when an epoch is about to end
on_minibatch_begin(callback_data, model, ...) Called when a minibatch is about to begin
on_minibatch_end(callback_data, model, ...) Called when minibatch is about to end
on_train_begin(callback_data, model, epochs) Called when training is about to begin
on_train_end(callback_data, model) Called when training is about to end
recursive_gen(pdict, key) helper method to check whether the definition
should_fire(callback_data, model, time, freq) Helper function for determining if a callback should do work at a given interval.

Attributes

be
classnm Returns the class name.
modulenm Returns the full module path.
be = None
classnm

Returns the class name.

gen_class(pdict)
get_description()

Serialize callback configuration.

modulenm

Returns the full module path.

on_epoch_begin(callback_data, model, epoch)

Called when an epoch is about to begin

Parameters:
  • callback_data (HDF5 dataset) – shared data between callbacks
  • model (Model) – model object
  • epoch (int) – index of epoch that is beginning
on_epoch_end(callback_data, model, epoch)[source]

Called when an epoch is about to end

Parameters:epoch (int) – index of epoch that is ending
on_minibatch_begin(callback_data, model, epoch, minibatch)

Called when a minibatch is about to begin

Parameters:
  • callback_data (HDF5 dataset) – shared data between callbacks
  • model (Model) – model object
  • epoch (int) – index of current epoch
  • minibatch (int) – index of minibatch that is beginning
on_minibatch_end(callback_data, model, epoch, minibatch)[source]

Called when minibatch is about to end

Parameters:
  • callback_data (HDF5 dataset) – shared data between callbacks
  • model (Model) – model object
  • epoch (int) – index of current epoch
  • minibatch (int) – index of minibatch that is ending
on_train_begin(callback_data, model, epochs)[source]

Called when training is about to begin

Parameters:
  • callback_data (HDF5 dataset) – shared data between callbacks
  • model (Model) – model object
  • epochs (int) – Total epochs
on_train_end(callback_data, model)

Called when training is about to end

Parameters:
  • callback_data (HDF5 dataset) – shared data between callbacks
  • model (Model) – model object
recursive_gen(pdict, key)

helper method to check whether the definition dictionary is defining a NervanaObject child, if so it will instantiate that object and replace the dictionary element with an instance of that object

should_fire(callback_data, model, time, freq)

Helper function for determining if a callback should do work at a given interval.

Parameters:
  • callback_data (HDF5 dataset) – shared data between callbacks
  • model (Model) – model object
  • time (int) – current time, in an arbitrary unit
  • freq (int, list, None) – firing frequency, in multiples of the unit used for time, or a list of times, or None (never fire)