|
Algorithm 1 Training of TD-LSTM networks |
|
Input:
|
| historical observations:; |
| target at time t: ; |
| lengths of closeness, period, trend: ; |
| period: p; |
|
Output:
|
| TD-LSTM model ; |
| //construct training instance |
| 1: ; |
| 2: for all available time interval
do
|
| 3: ; |
| 4: ; |
| 5: put a training instance () into ; |
| 6: end for
|
| // train model |
| 7: initialize parameter ; |
| 8: repeat
|
| 9: randomly select a batch of instances from ; |
| 10: find by optimization algorithm; |
| 11: until the objective is minimized |
| 12: output the optimized TD-LSTM model ; |