Deep Spatio-Temporal Residual Networks for Citywide Crowd Flows Prediction论文笔记

Four INOUT.h5 file

Each file has a h5 two subsets:

'Date': period list associated with the ** data **.

"Data": 4D shape of a tensor (number_of_timeslots, 2,32,32), where "data [i]" is a time block "date [i]" of the three-dimensional shape tensor (2,32,32), "data [i] [0]" is a "32x32" flows into the matrix, "data [i] [1]" is a "32x32" outflow matrix.

 

 

 

File name: "BJ_Meteorology.h5 ', it has the following four subsets:

* "Date": a list of the time period, the following types of data it is associated.

* "Temperature": a list of consecutive values, where "i ^ {th}" is "Date [i]" divided period "Temperature."

* "SPEED": a list of consecutive values, where "i ^ {th}" is "wind speed", "Date [i]" at.

* "Weather": 2D matrix, each of which is a hot vector ( "dim = 17"), one of the following types of weather:

Sunny = 0,
Cloudy = 1,
Overcast = 2,
Rainy = 3,
Sprinkle = 4,
ModerateRain = 5,
HeavyRain = 6,
Rainstorm = 7,
Thunderstorm = 8,
FreezingRain = 9,
Snowy = 10,
LightSnow = 11,
ModerateSnow = 12,
HeavySnow = 13,
Foggy = 14,
Sandstorm = 15,
Dusty = 16,

 

File name: "BJ_Holiday.txt ', including a list of vacation (and adjacent weekends) Beijing.

Each row of data in the format of [yyyy] [mm] [dd]. For example, "20150601" is "1 June 2015"

 

The most primitive data set has been divided into separate small areas throughout Beijing a 32 × 32, and each has a small area statistics of traffic in and out every half-hour (time sheet), i.e., has become represents [ 2,32,32] [2,32,32] [2,32,32] format. While achieving paper when used with the current time of the first three time slices to simulate proximity (Closeness), a time slice with the same time of day before the current time point to simulate periodic (Period), with the current time ago a time slice of the same time of the week to simulate the trend (trend), i.e. code len_closeness = 3, len_period = 1, len_trend = 1 as the hyper-parameters of three. It is to use three parts to predict the flow of time ti

Paper also introduced other additional meteorological data, namely: time_feature,holiday_feature,meteorol_featurethe final part of these three makes up a vectormeta_feature

 

For each time slice is:
time_feature 8 dimensions, the first seven dimensions as one-hot form, that represents the last day of whether days; e.g. meanings as in FIG p0069, corresponding to the time slice for the weekdays and Thursday .
holiday_feature have a dimension, where 0 represents the time slice of the day on weekdays, 1 holiday.
meteorol_feature dimensions 19, 17 are also in front of one-hot form, represent one type of weather, the latter two dimensions represent speed and temperature

Finally, the three vectors stitching became a 28-dimensional vector. In other words, now that we know the form of the input data across the network. For this part of data preprocessing, directly call the following function to obtain:

X_train, Y_train, X_test, Y_test, mmn, external_dim, timestamp_train, timestamp_test = \
load_data(len_closeness=3, len_period=1, len_trend=1, len_test=4*7* 48)

 

Network construction

First, define the input portions of the network, the author will be divided into five placeholdermeanings as variable name; then followed by the network part of the definition, i.e. Closeness, Period, Trend three parts and the weather module; final training module is to evaluate and . It is defined in the following these methods:

def _build_placeholder(self):
def _build_stresnet(self, ):
def evaluate(self, mmn, x, y):
def train(self, x, y):

 

operation result

 

 

 

 

Guess you like

Origin www.cnblogs.com/HIT-ryp/p/12148248.html