hazdzz / STGCN

The PyTorch implementation of STGCN.
GNU Lesser General Public License v2.1
484 stars 106 forks source link

It seems that the variable day_slot is not used. #14

Closed xyjigsaw closed 3 years ago

xyjigsaw commented 3 years ago

It seems that the variable day_slot is not used. How to implement the process mentioned in the paper?

The standard time interval in two datasets is set to 5 minutes. Thus, every node in road graphs contains 288 data points per day.

hazdzz commented 3 years ago

I don't understand what you mean.

xyjigsaw commented 3 years ago

Sorry to bother you, the variable day_slot is not used here.

def data_transform(data, n_his, n_pred, day_slot, device):
    # produce data slices for x_data and y_data

    n_vertex = data.shape[1]
    len_record = len(data)
    num = len_record - n_his - n_pred

    x = np.zeros([num, 1, n_his, n_vertex])
    y = np.zeros([num, n_vertex])

    for i in range(num):
        head = i
        tail = i + n_his
        x[i, :, :, :] = data[head: tail].reshape(1, n_his, n_vertex)
        y[i] = data[tail + n_pred - 1]

    return torch.Tensor(x).to(device), torch.Tensor(y).to(device)

But I've found it doesn't matter.