yalickj / load-forecasting-resnet

short-term load forecasting with deep residual networks
MIT License
90 stars 31 forks source link

How to achieve the Fig.8 in the paper? #7

Closed bailingbird closed 2 years ago

bailingbird commented 2 years ago

Fig.8 shows 95% prediction intervals for a winter week. Then, how to modify the code in order to achieve the Probabilistic Forecasting? Thanks very much.

yalickj commented 2 years ago

The code for Monte Carlo dropout is not included in this repository. To implement it: 1) add dropout layers to the model 2) train the model with a specific dropout rate (e.g., 0.05 or 0.1) 3) at test time, keep the dropout layers on and feedforward multiple times (e.g., 100 times) and calculate the variance for each hour in the horizon (term1 in eq. 8). 4) calculate term2 in eq. 8 on a validation set for each hour in the horizon. A coefficient may be needed to ensure proper empirical coverage. 5) combine term1 and term2 to obtain the total variance.

Currently I would suggest implementing it in PyTorch, which is much easier.