Last active
April 13, 2020 08:23
-
-
Save alonstern/f6083d63794b4ae49cd7d887d762e99b to your computer and use it in GitHub Desktop.
FunctionIdentificationDataset class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FunctionIdentificationDataset(torch.utils.data.Dataset): | |
def __init__(self, root_directory, block_size, padding_size): | |
data, tags = self._preprocess_data(root_directory) | |
self._data_blocks, self._tags_blocks = self._split_to_blocks(data, tags, block_size, padding_size) | |
def __len__(self): | |
return len(self._data_blocks) | |
def __getitem__(self, idx): | |
return self._data_blocks[idx], self._tags_blocks[idx] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment