Research Article

DCAST: A Spatiotemporal Model with DenseNet and GRU Based on Attention Mechanism

Algorithm 1

DCAST algorithm training process.
Input: historical observations: ; length of short-term dependence, period rule, and long-term dependence: , , ; span of period rule and long-term dependence: , ; external features:
 Output: DCAST, model
 //Generate samples from historical crowd flow observations
(1)
(2)For all available time interval do
(3)
(4)
(5)
(6)Put a training instance into
(7)End
(8)Divide into and
 //Train the model
(9)Initialize all the parameters in DCAST
(10)Repeat
(11)Randomly choose a batch of samples from
(12)Find by minimizing the objective (10) with
(13)Until stopping criteria is met
(14)Output the learned DCAST model