forked from ArnaudFickinger/DeepSequence-PyTorch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdataset.py
More file actions
32 lines (25 loc) · 716 Bytes
/
Copy pathdataset.py
File metadata and controls
32 lines (25 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
###
'''
April 2019
Code by: Arnaud Fickinger
'''
###
import torch
from utils import *
import numpy as np
class Dataset(torch.utils.data.Dataset):
def __init__(self, dataset_helper):
super(Dataset, self).__init__()
all_data = dataset_helper.x_train
self.data = all_data
# total_len = all_data.shape[0]
# if isTrain:
# self.len = int(0.8 * total_len)
# self.data = all_data[:self.len,:,:]
# else:
# self.len = total_len - int(0.8 * total_len)
# self.data = all_data[int(0.8 * total_len):,:,:]
def __getitem__(self, index):
return self.data[index]
def __len__(self):
return len(self.data)