The present invention relates to a time series learning apparatus, a time series learning method, a time series prediction apparatus, a time series prediction method, and a program, and particularly to a time series learning apparatus, a time series learning method, a time series prediction apparatus, a time series prediction method, and a program for predicting a future flow of people.
It is essential to analyze flows of people in a large-scale facility in which an event or the like is held and a traffic facility such as a station to consider congestion situations in advance, relieve the congestion, make plans for emergency evacuation guidance, and the like.
As a technology for analyzing such a flow of people, there is a time series prediction technology (for example, NPL 1) for predicting the degree of congestion in the future based on observation data in the past.
Usually, there are various restrictions (places at which observation devices can be installed, time zones, and the like) when observation data is collected, and some observation data pieces have strong correlation but others do not.
For example, if there are data pieces regarding the number of passersby that are measured at two different observation sites, usually, the shorter a travel distance between the observation sites is and the closer time zones in which the data pieces were observed are, the stronger correlation between the data pieces regarding the latest number of passersby tends to be.
Also, a travel route that many people pass may appear in a specific time zone depending on the observation site. For example, a travel route that many people pass while leaving work and going to a station appears in a time zone from the evening to the night.
As described above, correlation between observation data pieces varies according to geographical and temporal factors and the like, and therefore, in time series prediction, it is necessary to make adjustment as to which data among already obtained past observation data is used, the influence of which data is increased, and the like according to an observation point and conditions such as the time zone, in view of the correlation.
However, conventional technologies cannot deal with these problems or only partially deal with these problems, and therefore, there is a problem in that when time series prediction of the future is performed, precision of the prediction is low.
The present invention was made in view of the foregoing, and it is an object of the present invention to provide a time series learning apparatus, a time series learning method, and a program with which a prediction model for precisely predicting the number of passersby at a prediction time point can be learned.
It is another object of the present invention to provide a time series prediction apparatus, a time series prediction method, and a program with which the number of passersby at a prediction time point can be precisely predicted.
A time series learning apparatus according to the present invention is a time series learning apparatus configured to learn, with respect to each of a plurality of observation points, parameters of a prediction model for predicting the numbers of passersby at the observation points at a prediction time point based on the numbers of passersby at the observation points at an observation time point that are input, and includes: an input unit configured to accept input of learning data, a first weight, and a second weight with respect to each of the plurality of observation points, the learning data including a past time point of the observation point and the number of passersby at the observation point at the past time point, the first weight indicating the influence of the numbers of passersby at other observation points based on distances to the other observation points, the second weight indicating the influence of the numbers of passersby at the other observation points based on a travel route; and a learning unit configured to learn parameters of the prediction model with respect to each of the plurality of observation points based on the learning data such that the number of passersby at the observation point at a prediction time point predicted using the prediction model matches the number of passersby at a time point corresponding to the prediction time point included in the learning data, the prediction model having parameters including the first weight, the second weight, and a third weight that differs from the first weight and the second weight and indicates the influence of the numbers of passersby at the other observation points.
A time series learning method according to the present invention is a time series learning method for learning, with respect to each of a plurality of observation points, parameters of a prediction model for predicting the numbers of passersby at the observation points at a prediction time point based on the numbers of passersby at the observation points at an observation time point that are input, and includes: accepting, by an input unit, input of learning data, a first weight, and a second weight with respect to each of the plurality of observation points, the learning data including a past time point of the observation point and the number of passersby at the observation point at the past time point, the first weight indicating the influence of the numbers of passersby at other observation points based on distances to the other observation points, the second weight indicating the influence of the numbers of passersby at the other observation points based on a travel route; and learning, by a learning unit, parameters of the prediction model with respect to each of the plurality of observation points based on the learning data such that the number of passersby at the observation point at a prediction time point predicted using the prediction model matches the number of passersby at a time point corresponding to the prediction time point included in the learning data, the prediction model having parameters including the first weight, the second weight, and a third weight that differs from the first weight and the second weight and indicates the influence of the numbers of passersby at the other observation points.
According to the time series learning apparatus and the time series learning method according to the present invention, the input unit accepts input of learning data, a first weight, and a second weight with respect to each of the plurality of observation points. The learning data includes a past time point of the observation point and the number of passersby at the observation point at the past time point. The first weight indicates the influence of the numbers of passersby at other observation points based on distances to the other observation points. The second weight indicates the influence of the numbers of passersby at the other observation points based on a travel route.
Then, the learning unit learns parameters of the prediction model with respect to each of the plurality of observation points based on the learning data such that the number of passersby at the observation point at a prediction time point predicted using the prediction model matches the number of passersby at a time point corresponding to the prediction time point included in the learning data. The prediction model has parameters including the first weight, the second weight, and a third weight that differs from the first weight and the second weight and indicates the influence of the numbers of passersby at the other observation points.
As described above, parameters of the prediction model are learned with respect to each of the plurality of observation points based on learning data that includes, with respect to each of the plurality of observation points, a past time point of the observation point and the number of passersby at the observation point at the past time point. The parameters of the prediction model include a first weight that indicates the influence of the numbers of passersby at other observation points based on distances to the other observation points, a second weight that indicates the influence of the numbers of passersby at the other observation points based on a travel route, and a third weight that differs from the first weight and the second weight and indicates the influence of the numbers of passersby at the other observation points. The parameters are learned with respect to each observation point such that the number of passersby at the observation point at a prediction time point predicted using the prediction model matches the number of passersby at a time point corresponding to the prediction time point included in the learning data. Thus, a prediction model for precisely predicting the number of passersby at a prediction time point can be learned.
The prediction model of the time series prediction apparatus according to the present invention may also be a recurrent neural network.
A time series prediction apparatus according to the present invention is a time series prediction apparatus configured to predict the number of passersby at each of a plurality of observation points at a prediction time point by using a prediction model for predicting the numbers of passersby at the observation points at a prediction time point based on the numbers of passersby at the observation points at an observation time point, and includes: an input unit configured to accept input of observation data with respect to each of the plurality of observation points, the observation data including an observation time point of the observation point and the number of passersby at the observation point at the observation time point; and a prediction unit configured to predict the number of passersby at the observation point at the prediction time point from the observation data by using the prediction model that is learned in advance and has parameters including a first weight, a second weight, and a third weight with respect to the observation point, the first weight indicating the influence of the numbers of passersby at other observation points based on distances to the other observation points, the second weight indicating the influence of the numbers of passersby at the other observation points based on a travel route, the third weight differing from the first weight and the second weight and indicating the influence of the numbers of passersby at the other observation points.
A time series prediction method according to the present invention is a time series prediction method for predicting the number of passersby at each of a plurality of observation points at a prediction time point by using a prediction model for predicting the numbers of passersby at the observation points at a prediction time point based on the numbers of passersby at the observation points at an observation time point, and includes; accepting, by an input unit, input of observation data with respect to each of the plurality of observation points, the observation data including an observation time point of the observation point and the number of passersby at the observation point at the observation time point; and predicting, by a prediction unit, the number of passersby at the observation point at the prediction time point from the observation data by using the prediction model that is learned in advance and has parameters including a first weight, a second weight, and a third weight with respect to the observation point, the first weight indicating the influence of the numbers of passersby at other observation points based on distances to the other observation points, the second weight indicating the influence of the numbers of passersby at the other observation points based on a travel route, the third weight differing from the first weight and the second weight and indicating the influence of the numbers of passersby at the other observation points.
According to the time series prediction apparatus and the time series prediction method according to the present invention, the input unit accepts input of observation data with respect to each of the plurality of observation points. The observation data includes an observation time point of the observation point and the number of passersby at the observation point at the observation time point.
The prediction unit predicts the number of passersby at the observation point at the prediction time point from the observation data by using a prediction model that is learned in advance and has parameters including a first weight, a second weight, and a third weight with respect to the observation point. The first weight indicates the influence of the numbers of passersby at other observation points based on distances to the other observation points. The second weight indicates the influence of the numbers of passersby at the other observation points based on a travel route. The third weight differs from the first weight and the second weight and indicates the influence of the numbers of passersby at the other observation points.
As described above, the number of passersby at each of a plurality of observation points at a prediction time point is predicted from observation data that includes, with respect to each observation point, an observation time point of the observation point and the number of passersby at the observation point at the observation time point, by using a prediction model that is learned in advance and has parameters including a first weight, a second weight, and a third weight with respect to the observation point. The first weight indicates the influence of the numbers of passersby at other observation points based on distances to the other observation points, the second weight indicates the influence of the numbers of passersby at the other observation points based on a travel route, and the third weight differs from the first weight and the second weight and indicates the influence of the numbers of passersby at the other observation points. Thus, the number of passersby at a prediction time point can be precisely predicted.
A configuration is also possible in which the input unit of the time series prediction apparatus according to the present invention further accepts input of a first weight and a second weight with respect to the observation point, the first weight indicating the influence of the numbers of passersby at other observation points based on distances to the other observation points, the second weight indicating the influence of the numbers of passersby at the other observation points based on a travel route, and the prediction unit predicts the number of passersby at the observation point at the prediction time point from the observation data by using the first weight and the second weight accepted by the input unit as the first weight and the second weight included in the parameters of the prediction model.
A program according to the present invention is a program for causing a computer to function as each unit of the above-described time series learning apparatus or the above-described time series prediction apparatus.
With the time series learning apparatus, the time series learning method, and the program according to the present invention, a prediction model for precisely predicting the number of passersby at a prediction time point can be learned.
Also, with the time series prediction apparatus, the time series prediction method, and the program according to the present invention, the number of passersby at a prediction time point can be precisely predicted.
The following describes embodiments of the present invention using the Figures.
<Summary of Time Series Learning and Prediction Apparatus according to Embodiment of the Invention>
First, a summary of an embodiment of the present invention will be described.
In the embodiment of the present invention, the number of passersby at each observation point in the future is predicted when there is observation data regarding the number of passersby observed in the past at the observation point (
In the present embodiment, precision of time series prediction is improved by considering position information (
In
In this case, if only data regarding the close observation points is input, precision of the prediction is improved when compared to a case in which data regarding all observation points is input.
As described above, precision of prediction can be improved by weighting influence according to the prediction target observation point and the time point for which prediction is performed, while considering a distance to the prediction target observation point and the direction of travel.
Also, a main travel route of flows of people changes according to a time zone, a day of the week, the presence or absence of an event, and the like. For example, in
Precision of prediction can be improved by weighting influence while considering such a change of the travel route.
<Configuration of Time Series Learning and Prediction Apparatus according to First Embodiment of the Invention>
A configuration of a time series learning and prediction apparatus 10 according to an embodiment of the present invention will be described with reference to
The time series learning and prediction apparatus 10 is constituted by a computer that includes a CPU, a RAM, and a ROM in which a program for executing a learning processing routine and a prediction processing routine, which will be described later, is stored. The time series learning and prediction apparatus 10 has the following functional configuration.
As shown in
The input unit 100, the preprocessing unit 200, and the learning unit 300 perform processing for learning a prediction model for predicting the number of passersby at an observation point at a prediction time point. The input unit 500, the preprocessing unit 600, the prediction unit 700, and the output unit 800 perform processing for predicting the number of passersby at the observation point at the prediction time point by using the learned prediction model.
The input unit 100 accepts the following three types of input with respect to each of a plurality of observation points. First input is learning data that includes a past time point of the observation point and the number of passersby at the observation point at the past time point. Second input is a first weight that indicates the influence of the numbers of passersby at other observation points based on distances to the other observation points. Third input is a second weight that indicates the influence of the numbers of passersby at the other observation points based on a travel route.
Specifically, the input unit 100 accepts input of X, , , K, T, t, tw.
K is a constant that represents the number of observation points. If passersby travelling in different directions are observed at the same point, the point is taken to be different observation points. T is a constant that represents the length of an observation period, and T=[1,∞).
tw is a constant that indicates a time width of the number of passersby in the past that is input to perform prediction. tw=[1, ∞) and if tw=1, for example, data regarding a just preceding time point is used as input in the prediction.
Also,
represents the number of passersby (observation data) at each observation point. The number of passersby at an observation point k at a time point t is expressed as
X={x
k,t
|k=[1,K],t=[1,T]}.
Xt is a K-dimensional vector expressed as
X
t=[x1,t,x2,t, . . . ,xK,t].
As described above, the time series learning and prediction apparatus 10 according to the present embodiment is aimed at predicting the numbers of passersby
X
t+1=[x1,t+1,x2,t+1, . . . ,xK,t+1]
at K observation points at a time point t+1, when the numbers of passersby
X
t−t
+1
,X
t−t
+2
, . . . ,X
t
at the K observation points at time points t-tw+1, t-tw+2, t are input (
Also, a set
of first weight matrices indicating the influence of the numbers of passersby at other observation points with respect to each observation point, and a set
of second weight matrices indicating the influence of the numbers of passersby at the other observation points based on a travel route, with respect to each observation point, are defined by the following expressions (1) and (2).
[Formula 1]
={Wa,t+1,t
={Wr,t+1,t
Here,
tw′
is a variable that represents the difference between a prediction target time and a time point of input data that is used in prediction, and is defined as follows.
t
w′=[1,tw]
Also,
Wa,t+1,t
is a first weight matrix for considering the factor of a travel distance in comparison between conditions at a time point
t−tw′+1
and conditions at the prediction target time point t+1, and
Wa,t+1,t
More specifically,
Wa,t+1,t
where
t=[1,T],tw′=[1,tw]
is a K×K matrix for considering the influence that the number of passersby
Xt−t
at a time point preceding the prediction target time point t+1 by
tw′
has on the number of passersby
at the prediction target time point, from the standpoint of a travel distance between observation points and the like.
The first weight matrix
Wa,t+1,t
can vary according to a time point in order to consider a change in the travel distance between different observation points due to traffic regulation (closure of a road, etc.). If there is no influence of traffic regulation and the like in the observation period, for example, the first weight matrix that represents the influence from a just preceding time point is
W
a,t+1,1
=W
a,t,1
= . . . =W
a,2,1.
A set of the first weight matrices
Wa,t+1,t
is
A second weight matrix
Wr,t+1,t
is a weight matrix for considering the factor of a travel distance in comparison between conditions at the time point
t−tw′+1
and conditions at the prediction target time point t+1, and
Wr,t+1,t
More specifically, the second weight matrix, where
t=[1,T],tw′=[1,tw],
is a K×K matrix for considering the influence that the number of passersby
Xt−t
at the time point preceding the prediction target time point t+1 by
tw′
has on the number of passersby
at the prediction target time point, from the standpoint of a travel route.
The second weight matrix
Wr,t+1,t
can vary according to a time point in order to consider a change of a main travel route according to a time zone, a day in the week, and the like. If there is no change in the travel route and the like in the observation period, for example, the second weight matrix that represents the influence from a just preceding time point is
W
r,t+1,1
=W
r,t,1
= . . . =W
r,2,1.
If there is no information regarding the travel route and the like from the time point
t−tw′+1
to the time point t+1, the second weight matrix is
W
r,t+1,t
′
=O
Here,
is a zero matrix.
A set of the second weight matrices
Wr,t+1,t
is
Input of the first weight matrix
Wa,t+1,t
is given by a person, and input of the second weight matrix
Wr,t+1,t
may be given by a person or estimated in advance.
The input unit 100 gives accepted
X, , , K, T, t, tw
to the preprocessing unit 200.
The preprocessing unit 200 performs preprocessing that is necessary for learning processing performed by the learning unit 300, on
X, , , K, T, t, tw
accepted by the input unit 100.
Specifically, according to a learning algorithm (e.g., deep learning, a Markov chain, or the like) that is used by the learning unit 300, the preprocessing unit 200 performs processing for adjusting the size of the matrices and the like on
X, , , K, T, t, tw
accepted by the input unit 100.
Then, the preprocessing unit 200 gives the processed data
X, , , K, T, t, tw
to the learning unit 300.
The learning unit 300 learns parameters of a prediction model with respect to each of the plurality of observation points based on the learning data. This learning is performed such that the number of passersby at an observation point at a prediction time point predicted using the following prediction model matches the number of passersby at a time point corresponding to the prediction time point included in the learning data. The prediction model is a prediction model that has parameters including the set
of first weight matrices, the set
of second weight matrices, and a set
of third weight matrices that differ from the first weight matrix
Wa,t+1,t
and the second weight matrix
Wr,t+1,t
and indicate the influence of the numbers of passersby at the other observation points.
Specifically, the learning unit 300 learns, as the prediction model, a function F in which the data
X, , , K, T, t, tw
processed by the preprocessing unit 200 is used as input (the following expression (3)).
[Formula 2]
{circumflex over (X)}
t+1
=F(X,,,K,T,t,tw′) (3)
Here,
{circumflex over (X)}
t+1=[{circumflex over (x)}1,t+1,{circumflex over (x)}2,t+1, . . . ,{circumflex over (x)}K,t+1]
is a prediction value of the number of passersby at each observation point at the time point t+1. In one example, the function F, which is the prediction model, can be expressed by the following expression (4).
In the above expression (4),
Wo,t+1,t
is a third weight matrix for considering another factor that is not considered when the influence (
Wa,t+1,t
) of a travel distance between observation points and the like and the influence (
Wr,t+1,t
) of travel route information are considered.
is a set of the third weight matrices
Wo,t+1,t
and is defined by the following expression (5).
[Formula 4]
={Wo,t+1,t
Also, in the above expression (4),
αt+1,t
are parameters that determine the influence of the weight matrices
Wo,t+1,t
and sets of values of the respective parameters are defined by the following expressions (6) to (8).
[Formula 5]
α={αt+1,t
β={βt+1,t
γ={γt+1,t
If there is no information regarding the travel route and the like from the time point
t−tw′+1
to the time point t+1 (
W
r,t+1,t
′
=O
),
γt+1,t
The learning unit 300 performs optimization regarding the function
F(X, , , K, T, t, tw)
by minimizing an objective function expressed by the following expression (9), using a learning algorithm such as deep learning or a Markov chain.
The above expression (9) means that the set of third weight matrices and the parameters
(, α, β, γ)
of the function F are optimized and a prediction model for an observation target is computed, such that the difference between an observation value and a prediction value of the number of passersby at each observation point from a time point 1 to a time point T is minimized.
Then, the learning unit 300 stores the set of third weight matrices and the parameters
(, α, β, γ)
of the function F, which is the prediction model obtained through the above-described optimization, in the parameter storing unit 400.
The parameter storing unit 400 stores the parameters
(, α, β, γ)
of the prediction model.
The input unit 500 accepts the following three types of input with respect to each of a plurality of observation points. First input is observation data that includes an observation time point of the observation point and the number of passersby at the observation point at the observation time point. Second input is a set of first weight matrices regarding each observation point that indicate the influence of the numbers of passersby at other observation points based on distances to the other observation points. Third input is a set of second weight matrices regarding each observation point that indicate the influence of the numbers of passersby at the other observation points based on a travel route.
Specifically, the input unit 500 accepts input of
(X, , , K, T, t, tw)
as input data.
Then, the input unit 500 gives the accepted data
X, , , K, T, t, tw
to the preprocessing unit 600.
The preprocessing unit 600 performs preprocessing that is necessary for prediction processing performed by the prediction unit 700, on
X, , , K, T, t, tw
accepted by the input unit 500.
Specifically, according to the learning algorithm (e.g., deep learning, a Markov chain, or the like) used by the learning unit 300, the preprocessing unit 600 performs processing for adjusting the size of the matrices and the like on
X, , , K, T, t, tw
accepted by the input unit 500.
Then, the preprocessing unit 600 gives the processed data
X, , , K, T, t, tw
to the prediction unit 700.
The prediction unit 700 predicts the number of passersby at a prediction time point with respect to each of the plurality of observation points from the observation data, based on the following prediction model. The prediction model is the prediction model that is learned by the learning unit 300 and in which the set of first weight matrices and the set of second weight matrices that are input are used.
Specifically, the prediction unit 700 acquires the parameters
(, α, β, γ)
of the prediction model from the parameter storing unit 400, and predicts the number of passersby
at the prediction time point t+1 by using the function
F(X, , , K, T, t, tw)
Then, the prediction unit 700 gives the predicted number of passersby
at the prediction time point t+1 to the output unit 800.
The output unit 800 outputs the number of passersby
at the prediction time point t+1 predicted by the prediction unit 700.
<Functions of Time Series Learning and Prediction Apparatus According to First Embodiment of the Invention>
When learning data, a set of first weight matrices, and a set of second weight matrices are input to the input unit 100, the learning processing routine shown in
First, in step S100, the input unit 100 accepts input of learning data, a set of first weight matrices, and a set of second weight matrices.
In step S110, the preprocessing unit 200 performs preprocessing that is necessary for learning processing performed by the learning unit 300, on
X, , , K, T, t, tw
accepted by the input unit 100.
In step S120, the learning unit 300 initializes parameters α, β, and γ of the prediction model that determine the influence of the weight matrices
Wo,t+1,t
In step S130, the learning unit 300 optimizes a set
of third weight matrices, which is a parameter of the prediction model, by using the current parameters α, β, and γ, such that the number of passersby at an observation point at a prediction time point predicted using the prediction model matches the number of passersby at a time point corresponding to the prediction time point included in the learning data.
In step S140, the learning unit 300 optimizes the parameters α, β, and γ of the prediction model by using the set
of third weight matrices, which is the parameter of the current prediction model, such that the number of passersby at an observation point at a prediction time point predicted using the prediction model matches the number of passersby at a time point corresponding to the prediction time point included in the learning data.
In step S150, the learning unit 300 determines whether or not the learning has converged.
Upon determining that the learning has not converged (NO in step S150), the learning unit 300 returns to step S130 and again performs optimization.
In contrast, upon determining that the learning has converged (YES in step S150), in step S160, the learning unit 300 stores the set of third weight matrices and the parameters
(, α, β, γ)
of the function F, which is the prediction model obtained through the above-described optimization, in the parameter storing unit 400.
When observation data, a set of first weight matrices, and a set of second weight matrices are input to the input unit 500, the prediction processing routine shown in
First, in step S200, the input unit 500 accepts, with respect to each of a plurality of observation points, input of observation data that includes an observation time point of the observation point and the number of passersby at the observation point at the observation time point, a set of first weight matrices, and a set of second weight matrices.
In step S210, the preprocessing unit 600 performs preprocessing that is necessary for prediction processing performed by the prediction unit 700, on
X, , , K, T, t, tw
accepted by the input unit 500.
In step S220, the prediction unit 700 acquires the parameters
(, α, β, γ)
of the prediction model from the parameter storing unit 400.
In step S230, the prediction unit 700 predicts the number of passersby
at the prediction time point t+1 by using the function
F(X, , , K, T, t, tw)
which is the prediction model.
In step S240, the output unit 800 outputs the number of passersby
at the prediction time point t+1 predicted in the above-described step S230.
<Results of Experiments of Time Series Learning and Prediction Apparatus according to First Embodiment of the Invention>
As shown in
According to
As described above, the time series learning and prediction apparatus according to an embodiment of the present invention can learn a prediction model for precisely predicting the number of passersby at a prediction time point by learning parameters of the prediction model as described below. The learning is performed such that the number of passersby at each of a plurality of observation points at a prediction time point predicted using the following prediction model matches the number of passersby at a time point corresponding to the prediction time point included in the following learning data. The learning data is learning data that includes, with respect to each observation point, a past time point of the observation point and the number of passersby at the observation point at the past time point. The prediction model is a prediction model that has parameters including a first weight, a second weight, and a third weight with respect to each of the plurality of observation points, the first weight indicates the influence of the numbers of passersby at other observation points based on distances to the other observation points, the second weight indicates the influence of the numbers of passersby at the other observation points based on a travel route, and the third weight differs from the first weight and the second weight and indicates the influence of the numbers of passersby at the other observation points.
Also, the time series learning and prediction apparatus according to an embodiment of the present invention predicts, with respect to each of a plurality of observation points, the number of passersby at the observation point at a prediction time point from the following observation data by using the following prediction model. Therefore, the time series learning and prediction apparatus according to an embodiment of the present invention can precisely predict the number of passersby at the prediction time point. Here, the prediction model is a prediction model that has parameters including the following three weights and is learned in advance. A first weight is a weight that indicates the influence of the numbers of passersby at other observation points based on distances to the other observation points, with respect to each of the plurality of observation points. A second weight is a weight that indicates the influence of the numbers of passersby at the other observation points based on a travel route. A third weight is a weight that differs from the first weight and the second weight and indicates the influence of the numbers of passersby at the other observation points. The observation data is observation data that includes an observation time point of the observation point and the number of passersby at the observation point at the observation time point.
<Principle of Time Series Learning and Prediction Apparatus according to Second Embodiment of the Invention>
In the present embodiment, a case in which LSTM (Long Short Term Memory), which is one of recurrent neural networks, is used as the prediction model will be described.
If LSTM is used as the prediction model, parameters and the like are computed in the LSTM using the following expressions (10) to (15).
[Formula 7]
f
t=σ((Wf+Wfa,t+Wfr,t)Xt+(Rf+Rfa,t+Rfr,t)ht−1), (10)
i
t=σ((Wi+Wia,t+Wir,t)Xt+(Ri+Ria,t+Rir,t)ht−1), (11)
z
t=tanh((Wc+Wca,t+Wcr,t)Xt+(Rc+Rca,t+Rcr,t)ht−1), (12)
c
t
=f
t
⊙c
t−1
+i
t
⊙z
t, (13)
o
t=σ((Wo+Woa,t+Wor,t)Xt+(Ro+Roa,t+Ror,t)ht−1), (14)
h
t
=o
t⊙tanh(ct) (15)
Here,
⊙
is the element-wise product, and
σ(x)
is expressed by the following expression (16).
Here,
ft
is a parameter for computing a forget gate and determines a candidate to be disposed of from a cell state. Also,
it
is a parameter for computing an input gate and determines a candidate for which the cell state is updated.
zt
computes a value for updating the cell state, and
ot
computes an output gate.
ht
is an output value of the LSTM and is a prediction value at a time point t+1 (corresponding to the prediction value
in the first embodiment), and
h
t=[h1,th2,t, . . . ,hK,t].
The prediction value
ht
is not an input value, and is recurrently computed in the time series learning and prediction apparatus 10.
Out of matrices or vectors in the above expressions (10) to (15), except for those on the left side of the expressions
ft
and the like), an observation value
that is input, and a prediction value
ht−1
that is recurrently computed in the time series learning and prediction apparatus 10, all matrices represent weight matrices.
Among these weight matrices,
Wfa,t, Rfa,t
are first weight matrices that indicate the influence of the numbers of passersby at other observation points based on distances to the other observation points, with respect to each observation point. Also,
Wfr,t, Rfr,t
are second weight matrices that indicate the influence of the numbers of passersby at the other observation points based on a travel route, with respect to each observation point.
Wf, Wi, Wc, Wo, Rf, Ri, Rc, Ro
are third weight matrices that differ from the first weight matrices
Wfa,t, Rfa,t
and the second weight matrices
Wfr,t, Rfr,t
and indicate the influence of the numbers of passersby at the other observation points, with respect to each observation point.
The third weight matrices
Wf, Wi, Wc, Wo
and
Rf, Ri, Rc, Ro
are matrices that are learned. The first weight matrices and the second weight matrices (
Wfa,t, Wfr,t, Rfa,t, Rfr,t
and the like) other than the third weight matrices are matrices that are input.
The first weight matrix
is a weight matrix for considering the influence of the observation value
at a time point t in computation of the prediction value
ht
at the time point t+1 from the standpoint of a travel distance between observation points and the like. The second weight matrix
is a weight matrix for considering the influence of the observation value
at the time point t in computation of the prediction value
ht
at the time point t+1 from the standpoint of a travel route and the like.
Also, the first weight matrix
is a weight matrix for considering the influence of the prediction value
ht−1
at the time point t in computation of the prediction value
ht
at the time point t+1 from the standpoint of a travel distance between observation points and the like. The second weight matrix
is a weight matrix for considering the influence of the prediction value
ht−1
at the time point t in computation of the prediction value
ht
at the time point t+1 from the standpoint of a travel route and the like.
In the expression (11) relating to the input gate and the expression (14) relating to the output gate as well, weight matrices are input. The following expressions (17) to (20) show sets of these weight matrices.
[Formula 9]
={W*,t|t∈[1,T]}, (17)
={R*,t|t∈[1,T]}, (18)
={|*=(fa,fr,ia,ir,ca,cr,oa,or)}, (19)
={|*=(fa,fr,ia,ir,ca,cr,oa,or)} (20)
Here, “*” corresponds to subscripts (fa, fr, ia, ir, ca, cr, oa, or). That is, prediction performed by the time series learning and prediction apparatus 10 according to the present embodiment is expressed as a function
F(X, , , K, T, t)
in which
and
,
are used as input.
The optimum solution regarding the function F can be obtained by minimizing an objective function expressed by the following expression (21) with respect to eight weight matrices
Wf, Wi, Wc, Wo, Rf, Ri, Rc, Ro.
The above expression (21) means that the difference between an observation value and a prediction value of the number of passersby at each observation point from a time point 2 to a time point T is minimized to compute a prediction model for an observation target.
<Configuration of Time Series Learning and Prediction Apparatus according to Second Embodiment of the Invention>
The following describes a configuration of a time series learning and prediction apparatus 20 according to the second embodiment of the present invention. Note that units of the configuration that are similar to those in the time series learning and prediction apparatus 10 according to the first embodiment are denoted with the same reference signs as those used in the first embodiment and a detailed description thereof is omitted.
The input unit 100 accepts the following three types of input with respect to each of a plurality of observation points. First input is learning data
that includes a past time point of the observation point and the number of passersby at the observation point at the past time point. Second input is sets
fa, fa
of first weight matrices indicating the influence of the numbers of passersby at other observation points based on distances to the other observation points. Third input is sets
fr, fr
of second weight matrices indicating the influence of the numbers of passersby at the other observation points based on a travel route.
The learning unit 300 learns the third weight matrices
Wf, Wi, Wc, Wo, Rf, Ri, Rc, Ro
of the prediction model with respect to each of the plurality of observation points based on the learning data. This learning is performed such that the number of passersby at an observation point at a prediction time point predicted using the following prediction model matches the number of passersby at a time point corresponding to the prediction time point included in the learning data. The prediction model is a prediction model that has parameters including the sets
,
of first weight matrices, the sets
fr, fr
of second weight matrices, and the third weight matrices
Wf, Wi, Wc, Wo, Rf, Ri, Rc, Ro
Then, the learning unit 300 stores the third weight matrices
Wf, Wi, Wc, Wo, Rf, Ri, Rc, Ro
of the function
F(X, , , K, T, t),
which is the prediction model obtained through the above-described optimization, in the parameter storing unit 400.
The input unit 500 accepts the following three types of input with respect to each of a plurality of observation points. First input is observation data
that includes an observation time point of the observation point and the number of passersby at the observation point at the observation time point. Second input is sets
, fa
of first weight matrices indicating the influence of the numbers of passersby at other observation points based on distances to the other observation points. Third input is sets
fr, fr
of second weight matrices indicating the influence of the numbers of passersby at the other observation points based on a travel route.
The prediction unit 700 predicts the number of passersby
ht
at a prediction time point with respect to each of the plurality of observation points from the observation data
based on the following prediction model. The prediction model is the prediction model
F(X, , , k, T, t)
in which the sets
, fa
of first weight matrices and the sets
fr, fr
of second weight matrices are used and that is learned by the learning unit 300.
<Functions of Time Series Learning and Prediction Apparatus according to Second Embodiment of the Invention>
In step S300, the input unit 100 accepts the following three types of input with respect to each of a plurality of observation points. First input is learning data
that includes a past time point of the observation point and the number of passersby at the observation point at the past time point. Second input is sets
, fa
of first weight matrices indicating the influence of the numbers of passersby at other observation points based on distances to the other observation points. Third input is sets
fr, fr
of second weight matrices indicating the influence of the numbers of passersby at the other observation points based on a travel route.
In step S320, the learning unit 300 sets initial values for the third weight matrices
Wf, Wi, Wc, Wo, Rf, Ri, Rc, Ro.
In step S130, the learning unit 300 optimizes the third weight matrices
Wf, Wi, Wc, Wo, Rf, Ri, Rc, Ro,
which are parameters of the prediction model, as described below. The optimization is performed such that the number of passersby at an observation point at a prediction time point predicted using the prediction model matches the number of passersby at a time point corresponding to the prediction time point included in the learning data.
Note that a prediction processing routine according to the second embodiment is similar to that in the first embodiment.
As described above, the time series learning and prediction apparatus according to an embodiment of the present invention can learn a prediction model for precisely predicting the number of passersby at a prediction time point, by learning parameters of the prediction model that is a recurrent neural network.
Also, the time series learning and prediction apparatus according to an embodiment of the present invention can precisely predict the number of passersby at an observation point at a prediction time point by predicting the number of passersby at the prediction time point by using the prediction model that is a recurrent neural network learned in advance.
Note that the present invention is not limited to the above-described embodiments, and various modifications and applications can be made within a scope not departing from the gist of the invention.
In the above-described embodiments, a case in which a single apparatus is configured to perform learning and prediction is described, but the present invention is not limited to this configuration, and a time series learning apparatus that performs learning and a time series prediction apparatus that performs prediction may also be configured separately from each other.
Also, in the above-described example, a first weight matrix and a second weight matrix are input together with observation data when prediction is performed, but the present invention is not limited to this example, and if prediction is performed using a first weight matrix and a second weight matrix that are the same as those used in learning, input of the first weight matrix and the second weight matrix may also be omitted.
A program is installed in advance in the embodiments described in the present specification, but it is also possible to provide the program in a state of being stored in a computer-readable recording medium.
Number | Date | Country | Kind |
---|---|---|---|
2018-129353 | Jul 2018 | JP | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2019/027006 | 7/8/2019 | WO | 00 |