HALF.Delegates#

HALF.Delegates.DatasetIncreaseDelegate#

class HALF.Delegates.DatasetIncreaseDelegate.DatasetIncreaseDelegate[source]#

Bases: IDelegate

Class managing the selection of queries, handing them to the Oracle and the subsequent update of the labelled and unlabelled datasets

__init__(configAL, model, dataset_manager, oracle)[source]#

Class managing the selection of queries, ending them to the Oracle and the subsequent update of the labelled and unlabelled datasets

Parameters:
  • configAL (ConfigActiveLearner) – confif containing all parameters

  • model (pl.LightningModule) – model to train in the ative learning loop

  • dataset_manager (ALDatasetManager) – object manipulating the datasets

  • oracle (IOracle) – object giving the labels at each iteration of the active learning loop

run()[source]#

Select the indices of the samples to label with respect to their indices in the unlabelled dataset and update the datasets to move the samples from the unlabelled dataset to the labelled dataset

Returns:

list of indices of samples to labels with respect to their order in the unlabelled dataset

Return type:

List[int]

HALF.Delegates.DatasetTestingDelegate#

class HALF.Delegates.DatasetTestingDelegate.DatasetTestingDelegate[source]#

Bases: IDelegate

__init__(model, dataset_manager, config_dl, trainer)[source]#

Class managing the evaluation of the performance of the model on the test set

Parameters:
  • model (pl.LightningModule) – model to evaluate

  • dataset_manager (ALDatasetManager) – object where the test set is contained

  • config_dl (dict[str, Union[int,str,float]]) – configuration of the model for evaluation

  • trainer (pl.Trainer) – wrapper for the model training and evaluation

run()[source]#

Evaluate the performance of a model

Returns:

results of the evaluation of the model

Return type:

_EVALUATE_OUTPUT

HALF.Delegates.ModelTrainingDelegate module#

class HALF.Delegates.ModelTrainingDelegate.ModelTrainingDelegate[source]#

Bases: IDelegate

__init__(model, dataset_manager, config_dl, trainer)[source]#

Class managing the training of the model with the labelled set

Parameters:
  • model (pl.LightningModule) – model to train

  • dataset_manager (ALDatasetManager) – object where the labelled set is contained

  • config_dl (dict[str, Union[int,str,float]]) – configuration of the model for training

  • trainer (pl.Trainer) – wrapper for the model training and evaluation

run()[source]#

Run the training