Source code for rztdl.dl.dataset.dataset

# -*- coding: utf-8 -*-
"""
@created on: 12/15/19,
@author: Himaprasoon,
@version: v0.0.1

Description:

Sphinx Documentation Status:

"""

from abc import abstractmethod, ABCMeta
from typeguard import typechecked
from typing import List, Dict

from rztdl.dl.dataset.splits import TrainSplitHandler


[docs]class Dataset(metaclass=ABCMeta): @typechecked def __init__(self, buffer_names: List[str], name: str): self.split_buffer_name_mapping = {} self.tf_dataset = None self.name = name self.buffer_names = sorted(buffer_names) @abstractmethod @typechecked
[docs] def prepare_dataset(self, required_inputs: Dict[str, str], split_handler: TrainSplitHandler): pass # pragma: no cover
[docs] def set_split_buffer_name_mapping(self, split_names): for split_name in split_names: self.split_buffer_name_mapping[split_name] = self.buffer_names
[docs] def check_splits(self, split_handler: TrainSplitHandler = None): pass # pragma: no cover