core.split_strategy.AbstractSplitStrategy

 1from abc import ABC, abstractmethod
 2
 3
 4class AbstractSplitStrategy(ABC):
 5    """
 6    An abstract interface for splitting a dataset loader into separate subsets
 7    for training, prior training, validation, testing, or bound evaluation
 8    in a PAC-Bayes pipeline.
 9
10    Different implementations can define how the data is partitioned,
11    ensuring that prior data, posterior data, and bound data do not overlap.
12    """
13
14    @abstractmethod
15    def split(self, dataset_loader: "AbstractLoader", split_config: dict) -> None:
16        """
17        Partition the data from `dataset_loader` according to the configuration in `split_config`.
18
19        Args:
20            dataset_loader (AbstractLoader): A loader or dataset manager providing the raw dataset.
21            split_config (Dict): A dictionary specifying how to split the data
22                (e.g., batch_size, train/val/test percentages, random seeds, etc.).
23
24        Returns:
25            None: The method typically sets up instance attributes such as
26            `posterior_loader`, `prior_loader`, etc. for later access.
27        """
28        pass
class AbstractSplitStrategy(abc.ABC):
 5class AbstractSplitStrategy(ABC):
 6    """
 7    An abstract interface for splitting a dataset loader into separate subsets
 8    for training, prior training, validation, testing, or bound evaluation
 9    in a PAC-Bayes pipeline.
10
11    Different implementations can define how the data is partitioned,
12    ensuring that prior data, posterior data, and bound data do not overlap.
13    """
14
15    @abstractmethod
16    def split(self, dataset_loader: "AbstractLoader", split_config: dict) -> None:
17        """
18        Partition the data from `dataset_loader` according to the configuration in `split_config`.
19
20        Args:
21            dataset_loader (AbstractLoader): A loader or dataset manager providing the raw dataset.
22            split_config (Dict): A dictionary specifying how to split the data
23                (e.g., batch_size, train/val/test percentages, random seeds, etc.).
24
25        Returns:
26            None: The method typically sets up instance attributes such as
27            `posterior_loader`, `prior_loader`, etc. for later access.
28        """
29        pass

An abstract interface for splitting a dataset loader into separate subsets for training, prior training, validation, testing, or bound evaluation in a PAC-Bayes pipeline.

Different implementations can define how the data is partitioned, ensuring that prior data, posterior data, and bound data do not overlap.

@abstractmethod
def split(self, dataset_loader: 'AbstractLoader', split_config: dict) -> None:
15    @abstractmethod
16    def split(self, dataset_loader: "AbstractLoader", split_config: dict) -> None:
17        """
18        Partition the data from `dataset_loader` according to the configuration in `split_config`.
19
20        Args:
21            dataset_loader (AbstractLoader): A loader or dataset manager providing the raw dataset.
22            split_config (Dict): A dictionary specifying how to split the data
23                (e.g., batch_size, train/val/test percentages, random seeds, etc.).
24
25        Returns:
26            None: The method typically sets up instance attributes such as
27            `posterior_loader`, `prior_loader`, etc. for later access.
28        """
29        pass

Partition the data from dataset_loader according to the configuration in split_config.

Arguments:
  • dataset_loader (AbstractLoader): A loader or dataset manager providing the raw dataset.
  • split_config (Dict): A dictionary specifying how to split the data (e.g., batch_size, train/val/test percentages, random seeds, etc.).
Returns:

None: The method typically sets up instance attributes such as posterior_loader, prior_loader, etc. for later access.