thuml / Autoformer

About Code release for "Autoformer: Decomposition Transformers with Auto-Correlation for Long-Term Series Forecasting" (NeurIPS 2021), https://arxiv.org/abs/2106.13008
MIT License
2k stars 429 forks source link

Usage of Test Set in Every Epoch in exp/exp_main.py #197

Closed ceresshadows closed 1 year ago

ceresshadows commented 1 year ago

Description

In the train method within exp/exp_main.py, it appears that the test set is being used for evaluation at the end of each epoch. This is unconventional as the test set is typically reserved for a final evaluation after the model has been trained and validated using the training and validation sets, respectively.

To my understanding, it is used for monitoring the training process but not used for any hyperparameter adjustment during training. Is this correct? Thank you for the clarification!

Code Section


for epoch in range(self.args.train_epochs):
    # ... (training code here)

    # Evaluation on validation and test sets
    vali_loss = self.vali(vali_data, vali_loader, criterion)
    test_loss = self.vali(test_data, test_loader, criterion)

    print("Epoch: {0}, Steps: {1} | Train Loss: {2:.7f} Vali Loss: {3:.7f} Test Loss: {4:.7f}".format(
        epoch + 1, train_steps, train_loss, vali_loss, test_loss))
wuhaixu2016 commented 1 year ago

Hi, your understanding is correct. We print the test loss just for monitoring the training process.