Ground Truth Encoder

The ground truth encoder generates a ground truth value correlated with a sample, with index idx, from the preprocess. It will later be used as the ground truth for the loss function. This function is called for each evaluated sample.

For example:

from code_loader.contract.datasetclasses import PreprocessResponse

def gt_encoder(idx: int, preprocess: Union[PreprocessResponse, list]) -> np.ndarray:
    return preprocess.data.iloc[idx]['ground_truth'].astype('float32')

Usage within the full script can be found at the Dataset Script.

Guides

Full examples can be found at the Dataset Integration section of the following guides:

Last updated