underdoc-wang / mpgcn Goto Github PK
View Code? Open in Web Editor NEW[ICDE'20] Predicting Origin-Destination Flow via Multi-Perspective Graph Convolutional Network (Pytorch Replication)
License: MIT License
[ICDE'20] Predicting Origin-Destination Flow via Multi-Perspective Graph Convolutional Network (Pytorch Replication)
License: MIT License
Hello, the author. Excuse me. I want to ask about Data_ Container_ OD. Load in py_ What do the dimensions read from data represent? Why do I need to use reshape (- 1,47,47)?
Hello, dear author, can you provide me with Dataset?
Hi, author.
Your replica:
MPGCN(
(branch_models): ModuleList(
(0): ModuleDict(
(temporal): LSTM(1, 32, batch_first=True)
(spatial): ModuleList(
(0): BDGCN(
(activation): ReLU()
)
(1): BDGCN(
(activation): ReLU()
)
(2): BDGCN(
(activation): ReLU()
)
)
(fc): Sequential(
(0): Linear(in_features=32, out_features=1, bias=True)
(1): ReLU()
)
)
(1): ModuleDict(
(temporal): LSTM(1, 32, batch_first=True)
(spatial): ModuleList(
(0): BDGCN(
(activation): ReLU()
)
(1): BDGCN(
(activation): ReLU()
)
(2): BDGCN(
(activation): ReLU()
)
)
(fc): Sequential(
(0): Linear(in_features=32, out_features=1, bias=True)
(1): ReLU()
)
)
)
)
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)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.