future = 1000
pred = seq(test_input, future = future)
loss = criterion(pred[:, :-future], test_target)
print("test loss:", loss.data.numpy()[0])
y = pred.data.numpy()
// draw the result
plt.figure(figsize=(30,10))
plt.title("Predict future values for time sequences\n(Dashlines are predicted values)", fontsize=30)
After Change
pred = seq(test_input, future=future)
loss = criterion(pred[:, :-future], test_target)
print("test loss:", loss.item())
y = pred.detach().numpy()
// draw the result
plt.figure(figsize=(30,10))
plt.title("Predict future values for time sequences\n(Dashlines are predicted values)", fontsize=30)