Continuing from the previous post(172_Time Series Forecasting with LSTMs). def train_model( model, train_data, train_labels, test_data=None, test_labels=None): loss_fn = torch.nn.MSELoss(reduction='sum') optimiser = torch.optim.Adam(model.parameters(), lr=1e-3) num_epochs = 60 train_hist = np.zeros(num_epochs) test_hist = np.zeros(num_epochs) for t in range(num_epochs): model.r..