solr_keras module

class solr_keras.CandleRemoteMonitor(params=None)[source]

Bases: keras.callbacks.Callback

Capture Run level output and store/send for monitoring

on_epoch_begin(epoch, logs=None)[source]

Called at the start of an epoch.

Subclasses should override for any actions to run. This function should only be called during TRAIN mode.

Parameters
  • epoch – Integer, index of epoch.

  • logs – Dict. Currently no data is passed to this argument for this method but that may change in the future.

on_epoch_end(epoch, logs=None)[source]

Called at the end of an epoch.

Subclasses should override for any actions to run. This function should only be called during TRAIN mode.

Parameters
  • epoch – Integer, index of epoch.

  • logs

    Dict, metric results for this training epoch, and for the

    validation epoch if validation is performed. Validation result keys are prefixed with val_. For training epoch, the values of the

    Model’s metrics are returned. Example`{‘loss’: 0.2, ‘accuracy’:

    0.7}`.

on_train_begin(logs=None)[source]

Called at the beginning of training.

Subclasses should override for any actions to run.

Parameters

logs – Dict. Currently no data is passed to this argument for this method but that may change in the future.

on_train_end(logs=None)[source]

Called at the end of training.

Subclasses should override for any actions to run.

Parameters

logs – Dict. Currently the output of the last call to on_epoch_end() is passed to this argument for this method but that may change in the future.

save()[source]

Save log_messages to file

class solr_keras.TerminateOnTimeOut(timeout_in_sec=10)[source]

Bases: keras.callbacks.Callback

This class implements timeout on model training. When the script reaches timeout, this class sets model.stop_training = True

on_epoch_end(epoch, logs={})[source]

On every epoch end, check whether it exceeded timeout and terminate training if necessary

on_train_begin(logs={})[source]

Start clock to calculate timeout

solr_keras.compute_trainable_params(model)[source]

Extract number of parameters from the given Keras model

Parameters

model (Keras model) –

Returns

python dictionary that contains trainable_params, non_trainable_params and total_params