objects

Callbacks

🎉 New feature introduced in pyhectiqlab>=2.0.11 🎉

For tensorflow user, you can use the pyhectiqlab.callbacks.KerasCallback object to push automatically your metrics. It supports the training, validattion and prediction metrics.

Usage

You simply need to create a run and use it to initialize the callback.

from pyhectiqlab import Run
from pyhectiqlab.callbacks import KerasCallback
run = Run(name="Push metrics", project="lab/demo")

callback = KerasCallback(run=run)

# Use it
model.fit(
    x_train,
    y_train,
    callbacks=[callback],
)

The callback supports other parameters for additional control over what you push.

Method

pyhectiqlab.callbacks.KerasCallback(run: pyhectiqlab.Run, level: str = batch, exclude_train_metrics: bool = False, exclude_val_metrics: bool = False, exclude_predict_metrics: bool = False, exclude_metrics: List[str] = [])
A custom callback object for keras models.

Parameters

PropertyTypeDefaultDescription
runpyhectiqlab.Run-The target run to host the metrics
levelstrbatchEither 'batch' or 'epoch'. If 'batch', the metrics are pushed on every batch and the stepstamp incremented on every batch. If 'epoch', the metrics are pushed every epoch.
exclude_train_metricsboolFalseSet to true to exclude the training metrics.
exclude_val_metricsboolFalseSet to true to exclude the validation metrics.
exclude_predict_metricsboolFalseSet to true to exclude the prediction metrics.
exclude_metricsList[str][]List the metrics to remove from tracking. For validation metrics, add 'val_'. For instance, use `exclude_metrics=['mse', 'val_mse']` to exclude the `mse` metrics in training and validation.