Thanks, I was mostly asking for a model implementation, I had created something similar to build my dataset:
def sliding_window(data, window=20, step=5):
"Creates a new Tensor of windowed data every step"
num_pieces = int((data.shape[1]-1-window)/step); num_pieces
X = []
y = []
for j in range(num_pieces):
X.append(data[:,step*j:step*j+window])
y.append(data[-1,step*j+window+1])
return torch.stack(X) , torch.stack(y)
With this, I have a dataset that is
X.shape, y.shape
>>(torch.Size([70270, 3, 24]), torch.Size([70270]))
I was trying a naive Convnet, but it does not seems to work at all:
basic_conv = nn.Sequential(nn.Conv1d(3, 32, 3),
nn.Conv1d(32, 64, kernel_size=3, stride=2, padding=1),
nn.Conv1d(64, 64, kernel_size=3, stride=1),
nn.Conv1d(64, 128, kernel_size=3, stride=2, padding=1),
nn.Conv1d(128, 128,kernel_size=3, stride=1),
AdaptiveConcatPool1d(),
Flatten(),
nn.Linear(128*2, 512),
nn.ReLU(),
nn.Linear(512,1)
)
Any recommendations?