Welcome to wandb-callbacks’s documentation!

tensorflow.py

class wandb_callbacks.tensorflow.ActivationCallback(validation_data, layer_name, log_frequency=5)[source]

ActivationCallback.

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

on_epoch_end. Called at the end of an epoch.

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, ‘acc’: 0.7}.

class wandb_callbacks.tensorflow.DeadReluCallback(x_train, log_frequency=1, dead_threshold=0.8, verbose=False)[source]

DeadReluCallback.

Reports the number of dead ReLUs after each training epoch. ReLU is considered to be dead if it did not fire once for entire training set.

get_relu_activations()[source]

get_relu_activations. Retreives all RELU activations of the current model.

static is_relu_layer(layer)[source]

is_relu_layer. Checks if a certain layer contains a RELU activation.

Parameters

layer – layer object to check.

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

on_epoch_end. Called at the end of an epoch.

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, ‘acc’: 0.7}.

class wandb_callbacks.tensorflow.GRADCamCallback(validation_data, layer_name, log_frequency=10)[source]

GRADCamCallback.

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

on_epoch_end. Called at the end of an epoch.

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, ‘acc’: 0.7}.

utils.py

class wandb_callbacks.utils.GradCAM(model, layerName)[source]
Reference:

https://www.pyimagesearch.com/2020/03/09/grad-cam-visualize-class-activation-maps-with-keras-tensorflow-and-deep-learning/

wandb_callbacks.utils.get_samples_for_activation(class_names, X_val, Y_val)[source]

get_samples_for_activation. Returns sample images from the given data. Sample images contain one image per class in the dataset.

Parameters
  • class_names – class names of the dataset.

  • X_val – features of the dataset.

  • Y_val – labels of the dataset.

Indices and tables