TrainingCallbacks¶
Training Callbacks for training monitoring integrated in pythae (inspired from https://github.com/huggingface/transformers/blob/master/src/transformers/trainer_callback.py)
- class pythae.trainers.training_callbacks.TrainingCallback[source]¶
Base class for creating training callbacks
- on_eval_step_begin(training_config, **kwargs)[source]¶
Event called at the beginning of a evaluation step.
- on_init_end(training_config, **kwargs)[source]¶
Event called at the end of the initialization of the [Trainer].
- class pythae.trainers.training_callbacks.CallbackHandler(callbacks, model)[source]¶
Class to handle list of Callback.
- class pythae.trainers.training_callbacks.MetricConsolePrinterCallback[source]¶
A
TrainingCallbackprinting the training logs in the console.
- class pythae.trainers.training_callbacks.ProgressBarCallback[source]¶
A
TrainingCallbackprinting the training progress bar.- on_eval_step_begin(training_config, **kwargs)[source]¶
Event called at the beginning of a evaluation step.
- class pythae.trainers.training_callbacks.WandbCallback[source]¶
A
TrainingCallbackintegrating the experiment tracking tool wandb (https://wandb.ai/).It allows users to store their configs, monitor their trainings and compare runs through a graphic interface. To be able use this feature you will need:
a valid wandb account
the package wandb installed in your virtual env. If not you can install it with
$ pip install wandb
to be logged in to your wandb account using
$ wandb login
- setup(training_config, model_config=None, project_name='pythae_experiment', entity_name=None, **kwargs)[source]¶
Setup the WandbCallback.
- Parameters
training_config (BaseTrainerConfig) – The training configuration used in the run.
model_config (BaseAEConfig) – The model configuration used in the run.
project_name (str) – The name of the wandb project to use.
entity_name (str) – The name of the wandb entity to use.
- class pythae.trainers.training_callbacks.MLFlowCallback[source]¶
A
TrainingCallbackintegrating the experiment tracking tool mlflow (https://mlflow.org/).It allows users to store their configs, monitor their trainings and compare runs through a graphic interface. To be able use this feature you will need:
the package mlfow installed in your virtual env. If not you can install it with
$ pip install mlflow
- setup(training_config, model_config=None, run_name=None, **kwargs)[source]¶
Setup the MLflowCallback.
- Parameters
training_config (BaseTrainerConfig) – The training configuration used in the run.
model_config (BaseAEConfig) – The model configuration used in the run.
run_name (str) – The name to apply to the current run.
- class pythae.trainers.training_callbacks.CometCallback[source]¶
A
TrainingCallbackintegrating the experiment tracking tool comet_ml (https://www.comet.com/site/).It allows users to store their configs, monitor their trainings and compare runs through a graphic interface. To be able use this feature you will need:
the package comet_ml installed in your virtual env. If not you can install it with
$ pip install comet_ml
- setup(training_config, model_config=None, api_key=None, project_name='pythae_experiment', workspace=None, offline_run=False, offline_directory='./', **kwargs)[source]¶
Setup the CometCallback.
- Parameters
training_config (BaseTraineronfig) – The training configuration used in the run.
model_config (BaseAEConfig) – The model configuration used in the run.
api_key (str) – Your personal comet-ml api_key.
project_name (str) – The name of the wandb project to use.
workspace (str) – The name of your comet-ml workspace
offline_run – (bool): Whether to run comet-ml in offline mode.
offline_directory (str) – The path to store the offline runs. They can to be synchronized then by running comet upload.