HALF.Interfaces#

HALF.Interfaces.AbstractModel#

class HALF.Interfaces.AbstractModel.AbstractModel[source]#

Bases: ABC, LightningModule

Abstract class for the model used in the framework by the Active Learner

abstract forward(x, last=False)[source]#

Forward pass through model

Parameters:
  • x (T.torch) – input

  • last (bool, optional) – If True, return an (output, embedding) tuple. Defaults to False.

abstract get_embedding_dim()[source]#

Get dimensionality (number of features) of the embedding

Returns

int : The dimensionality

Return type:

int

reset()[source]#

Resets model parameters

training: bool#

HALF.Interfaces.IDataset#

class HALF.Interfaces.IDataset.IDataset[source]#

Bases: ABC, Dataset

Interface for Dataset methods

abstract create_datasets()[source]#

This method should create the labeled, unlabeled and test datasets (pytorch.utils.data.Dataset)

abstract property test_transform#

List of tranforms operations for test set

abstract property train_transform#

List of tranforms operations for train set

HALF.Interfaces.IDelegate#

class HALF.Interfaces.IDelegate.IDelegate[source]#

Bases: ABC

Abstract class for Delegate design pattern

abstract run()[source]#

HALF.Interfaces.IHook#

class HALF.Interfaces.IHook.ActiveLearner[source]#

Bases: object

class HALF.Interfaces.IHook.IHook[source]#

Bases: ABC

Abstract class for Hooks and events

abstract apply(al, *args, **kwargs)[source]#
Parameters:

al (ActiveLearner) –

HALF.Interfaces.IOracle#

class HALF.Interfaces.IOracle.IOracle[source]#

Bases: ABC

Asbtract class for the Oracle, labeller of the data

abstract query(list_dict)[source]#

Query new labels for passed data

Parameters:

list_dict (List[Dict]) – The points to label

HALF.Interfaces.IUnifiedStrategy#

class HALF.Interfaces.IUnifiedStrategy.IUnifiedStrategy[source]#

Bases: ABC

Abstract class for a strategy, which selects datapoints to be labelled

__init__()[source]#
abstract query(list_dict)[source]#

Query points to be labeled

Args :

list_dict List[Dict] : list of dictionaries containing the index of the query and the data

Parameters:

list_dict (List[Dict]) –