Source code for datumaro.plugins.sampler.algorithm.algorithm

# Copyright (C) 2021 Intel Corporation
#
# SPDX-License-Identifier: MIT

from enum import Enum, auto


[docs] class SamplingMethod(Enum): topk = auto() lowk = auto() randk = auto() mixk = auto() randtopk = auto()
[docs] class Algorithm(Enum): entropy = auto()
[docs] class InferenceResultAnalyzer: """ Basic interface for IRA (Inference Result Analyzer) """ def __init__(self, dataset, inference): self.data = dataset self.inference = inference self.sampling_method = SamplingMethod
[docs] def get_sample(self, method: str, k: int): raise NotImplementedError()