Closed kooper9934 closed 4 months ago
0 20 40 60 80 是测试集上的结果,作者在代码中将测试集上每20个迭代次数的真实值与预测值绘制出来,并保存为pdf。 def test(self, setting, test=0):
....... ## with torch.no_grad(): for i, (batch_x, batch_y, batch_x_mark, batch_y_mark) in enumerate(test_loader): pred, true = self._process_one_batch(test_data, batch_x, batch_y, batch_x_mark, batch_y_mark) preds.append(pred.detach().cpu().numpy()) trues.append(true.detach().cpu().numpy()) if i % 20 == 0: input = batch_x.detach().cpu().numpy() gt = np.concatenate((input[0, :, -1], true[0, :, -1]), axis=0) pd = np.concatenate((input[0, :, -1], pred[0, :, -1]), axis=0) visual(gt, pd, os.path.join(folder_path, str(i) + '.pdf'))
和上面同学说的一样,就是每20个batch存下来的sample
0 20 40 60 80 是测试集上的结果,作者在代码中将测试集上每20个迭代次数的真实值与预测值绘制出来,并保存为pdf。 def test(self, setting, test=0):