Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to implement single-step forecasting in DGCRN? #61

Closed
zhishiouo opened this issue Jul 30, 2023 · 8 comments
Closed

How to implement single-step forecasting in DGCRN? #61

zhishiouo opened this issue Jul 30, 2023 · 8 comments

Comments

@zhishiouo
Copy link

Why is my single-step prediction accuracy low?

@zhishiouo
Copy link
Author

Is there a requirement for input and output step size?

@zezhishao
Copy link
Owner

Is there a requirement for input and output step size?

Yes, here are the steps:

  • Generate samples: python scripts/data_preparation/${DATASET_NAME}/generate_training_data.py --history_seq_len 12 future_seq_len 1
  • Change the CFG.DATASET_OUTPUT_LEN and CFG.DATASET_INPUT_LEN in the config files.
  • Change training parameters (optional). For example, for single step forecasting, the curriculum learning is no longer useful, and you can just delete the CFG.TRAIN.CL dict.
  • Change the model parameters (optional) The parameters of the model need to read its original paper to determine how to modify it.

@zhishiouo
Copy link
Author

Modified by the above method, but the prediction accuracy is not ideal.Not even as good as multi-step prediction.

@zhishiouo
Copy link
Author

And just delete the dict.CFG.TRAIN.CL, but an error occurred in the program.I modify CFG.TRAIN.CL.PREDICTION_LENGTH = 1,It can run, but with poor accuracy

@zezhishao
Copy link
Owner

And just delete the dict.CFG.TRAIN.CL, but an error occurred in the program.

The reason is that the DGCRN model requires the implementation of CL (for details, please refer to its paper). Please use the following configuration:

...
CFG.DATASET_INPUT_LEN = 12
CFG.DATASET_OUTPUT_LEN = 1 # *** change the DATASET_OUTPUT_LEN from 12 to 1 ***
CFG.MODEL.PARAM = {
    "gcn_depth": 2,
    "num_nodes": 207,
    "predefined_A": [torch.Tensor(_) for _ in adj_mx],
    "dropout": 0.3,
    "subgraph_size": 20,
    "node_dim": 40,
    "middle_dim": 2,
    "seq_length": 1, # *** change the seq_length from 12 to 1 ***
    "in_dim": 2,
    "list_weight": [0.05, 0.95, 0.95],
    "tanhalpha": 3,
    "cl_decay_steps": 4000,
    "rnn_size": 64,
    "hyperGNN_dim": 16
}
...
## curriculum learning
CFG.TRAIN.CL = EasyDict()
CFG.TRAIN.CL.WARM_EPOCHS = 0
CFG.TRAIN.CL.CL_EPOCHS = 1
CFG.TRAIN.CL.PREDICTION_LENGTH  = 1
...
# ***add the evaluation horizon configs***
CFG.EVAL = EasyDict()
CFG.EVAL.HORIZONS = [1]

@zezhishao
Copy link
Owner

By the way, kindly note that the acc of single-step prediction is not necessarily better than the acc of multi-step prediction at Horizon 1.

@zhishiouo
Copy link
Author

thanks

@zhishiouo
Copy link
Author

I want to ask you the reason that the acc of single-step prediction is not necessarily better than the acc of multi-step prediction at Horizon 1. And Why the acc of multi-step prediction at Horizon 1 does not decline with iteration.
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants