Skip to main content
. 2018 Nov 6;18(11):3797. doi: 10.3390/s18113797
Algorithm 1 Training of TD-LSTM networks
Input:
 historical observations:X1,,Xn1;
 target at time t: Xt;
 lengths of closeness, period, trend: lc,lp;
 period: p;
Output:
 TD-LSTM model M;
 //construct training instance
 1: D;
 2: for all available time interval t(1tn1) do
 3: Sc=[Xtlc,Xt(lc1),,Xt1];
 4: Sp=[Xtlp·p,Xt(lp1)·p,,Xtp];
 5: put a training instance (Sc,Sp) into D;
 6: end for
 // train model
 7: initialize parameter θ;
 8: repeat
 9: randomly select a batch of instances from D;
10:   find θ by optimization algorithm;
11: until the objective is minimized
12: output the optimized TD-LSTM model M;