neon.callbacks.callbacks.BatchNormTuneCallback

class neon.callbacks.callbacks.BatchNormTuneCallback(tune_set, epoch_freq=1)[source]

Bases: neon.callbacks.callbacks.Callback

Callback for tuning batch norm parameters with unbiased estimators for global mean and var.

Parameters:tune_set (Dataset) – data set over which to tune parameters (usually a subset of the training set)
__init__(tune_set, epoch_freq=1)[source]

Methods

__init__(tune_set[, epoch_freq])
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 a 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.
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:
  • callback_data (HDF5 dataset) – shared data between callbacks
  • model (Model) – model object
  • 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)

Called when a 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)

Called when training is about to begin

Parameters:
  • callback_data (HDF5 dataset) – shared data between callbacks
  • model (Model) – model object
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)