You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the model input, what do the O_dyn_G and D_dyn_G means? it seems that you treat the origin and destination individually?
def construct_dyn_G(self, OD_data: np.array,
perceived_period: int = 7): # construct dynamic graphs based on OD history
train_len = int(OD_data.shape[0] * self.params['split_ratio'][0] / sum(self.params['split_ratio']))
num_periods_in_history = train_len // perceived_period # dump the remainder
OD_history = OD_data[:num_periods_in_history * perceived_period, :, :, :]
O_dyn_G, D_dyn_G = [], []
for t in range(perceived_period):
OD_t_avg = np.mean(OD_history[t::perceived_period, :, :, :], axis=0).squeeze(axis=-1)
O, D = OD_t_avg.shape
O_G_t = np.zeros((O, O)) # initialize O graph at t
for i in range(O):
for j in range(O):
O_G_t[i, j] = distance.cosine(OD_t_avg[i, :], OD_t_avg[j, :]) # eq (6)
D_G_t = np.zeros((D, D)) # initialize D graph at t
for i in range(D):
for j in range(D):
D_G_t[i, j] = distance.cosine(OD_t_avg[:, i], OD_t_avg[j, :]) # eq (7)
O_dyn_G.append(O_G_t), D_dyn_G.append(D_G_t)
return np.stack(O_dyn_G, axis=-1), np.stack(D_dyn_G, axis=-1)
The text was updated successfully, but these errors were encountered:
Hi, author.
O_dyn_G
andD_dyn_G
means? it seems that you treat the origin and destination individually?The text was updated successfully, but these errors were encountered: