Giter Club home page Giter Club logo

stgcn_ijcai-18's People

Contributors

veritasyin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stgcn_ijcai-18's Issues

The hyperparameter setting under BJER4 scenario

Really appreciate your excellent work on the traffic prediction topic and open source efforts. I am trying to reproduce the performance of your paper on a dataset really similar to BJER4. I changed the essential hyperparameters and the code ran successfully. However, I cannot achieve a satisfactory result and the MAE is even worse than simple FNN and XGboost algorithm.
So my issue is that is there any settings that are really important need to be changed if the road network is smaller than Pems dataset?

About the S-T blocks.

Hi there,
May I ask why the S-T blocks are the so-called sandwich structure?
What is the strategy or reason of this?
Thanks!

Asking for the sensor location for PeMSD7-M

Hello Yin,

Thank you for releasing your source code and dataset! It helped me a lot on my own research project!
But in this repo you only uploaded the speed series data and the graph weight matrix. Could you please generously release the geographical location (latitude&longitude) of sensors in PeMSD7-M? or the list of sensor IDs so that I can visualize them on the map.
I also checked other closed issues in which you said you will release the full list of station ID of PeMSD7-L soon.

I'm very looking forward to your update!

Thanks in advance

Settings for n_his and Kt

Is there exists any relation between n_his and n_pred, like n_his:n_pred = 4:3? And does Kt must be 3 in ST-block?

STGCN(Cheb) and STGCN(1st)

Hello, I wonder whether the source code is about STGCN(Cheb)? How can I get STGCN(1st)? Ks = Kt =2?
And in your paper, you say"the channels of three layers in ST-Conv block are 64, 16, 64 respectively. ", but it seems that it is [1,32,64][64,32,128] in your source code?

How to generate the W file?

Hi @VeritasYin ,

How do you calculate the distance between the stations? Is it distance through the road network, or "as the crow flies"?

Do you have the list of the ID of the 228 and 1,026 stations? So we can know which stations you use.

How to find out the connectivity between stations?

Thank you,
AP

Originally posted by @arianprabowo in #18 (comment)

Issue on the Normalization Trick.

Hi, I think your code is very organized and neat, I really like it.

However, I have some questions about your code regarding the graph kernel generation. This is the link about how to do the normalization on the Laplacian matrix. In particular, we have to obtain symmetrically normalized laplacian formatted as follow.
Screen Shot 2019-06-04 at 3 45 35 PM

In contrast, your code goes like this:

    for i in range(n):
        for j in range(n):
            if (d[i] > 0) and (d[j] > 0):
                L[i, j] = L[i, j] / np.sqrt(d[i] * d[j])

Can you tell me what your idea about this?

Solving for 2 variables

What are the main modifications for me to consider if I were to solve for more than just velocity ? I believe the number of channels should be changed accordingly ? (2 variables to be predicted meaning 2 channels).

On the other hand, could you please elaborate on what was done in the lines below ? It wasn't very clear to me how they contributed to the multi-prediction function

step_idx = tmp_idx = np.arange(3, n_pred + 1, 3) - 1
min_val = min_va_val = np.array([4e1, 1e5, 1e5] * len(step_idx))

PeMS(L) dataset

Hello, did you release the full list of station ID of PeMSD7-L?

input data

whats the input of your algorithm and its dimension?

Dataset release

Are you planing to release the dataset?
Thank you in advance.

run on METR-LA and PEMS-BAY

Hi Dr Yin

I am wondering if you can make the code to run on the METR-LA and PEMS-BAY dataset with standard split given by https://github.com/liyaguang/DCRNN. I personally tried to run your codes on those two datasets but can not get expected results. If yes, I will include your methods as a baseline in my recent work.

Thanks

Tips for using repo in colab

Hi, I read your paper, my background is not mathematics but I could follow the main reasoning.

I would like to use the git to better understand the steps described in the paper, and then to try apply on my own datasets for learning purposes.

I tried cloning the git on colab, run python main.py as test:

Training configs: Namespace(batch_size=50, epoch=50, graph='default', inf_mode='merge', ks=3, kt=3, lr=0.001, n_his=12, n_pred=9, n_route=228, opt='RMSProp', save=10)
ERROR: input file was not found in ./dataset/PeMSD7_W_228.csv.
Traceback (most recent call last):
  File "main.py", line 51, in <module>
    W = weight_matrix(pjoin('./dataset', f'PeMSD7_W_{n}.csv'))
  File "/content/STGCN_IJCAI-18/utils/math_graph.py", line 86, in weight_matrix
    if set(np.unique(W)) == {0, 1}:
UnboundLocalError: local variable 'W' referenced before assignment

Do you have time to provide for a documentation ?

If guided step by step, I am also willing to refactor code for jupyter / colab environment.
It will be a learning experience for me to structure a GNC model, and I think useful for others too.

I am also interested in using DGL - begineer, but it seems a tool purposufully designed for this types of models.

Please have a look:
https://github.com/dmlc/dgl

Question on Baseline Models

In the baseline models that you implemented(HA, ARIMA, LSVR, etc.); were they trained solely on the temporal data or the entire spatio-temporal data?

About data cleaning

Hi,

I wonder if the data you post has been cleaned, I mean the two csv files in PeMs-M.

Best

Dataset cannot be downloaded

image

Hi there is no option for Time Period . Hence all we have is a list of txt for each month in available files:

image

Dimensions of the Input Dataset

Hi,
I was having troble downloading and interpreting the dataset form PEMS, can you please let us know what is the dimension of the Input dataset, or please let me know if my interpretation is correct:

PeMSD7_W_228.csv: It is a weighted adjacency matrix of the graph with nodes n, size = nn
PeMSD7_V_228.csv: It has time series data for every node in graph, size =n
T , where T is len of time series.

About data partitioning

I noticed that you divided the data into training validation and test sets, and I found that the data provided in your code can be divided into 44 days by 288, and the number of days in the original data should be 61 days. Can you put the test and validation sets in? thank you very much.

How to download the dataset from PeMS website?

Hi, VeritasYin:
I really got impressed by this paper (STGCN-IJCAI-18). But there is no dataset in your code, and the PeMSD7 link is not very clear what data needs to be exported as a dataset. I'm hoping to get your help. Thank you very much for your help and looking forward to your reply.
Have a nice day!

Regards,
Wendong

Dataset upload

Hi we are very interested in your paper, can you open source your dataset?

Thanks a lot!

Questions about the Implementation of Graph Convolution

In code,the function Conv_Graph(), I can't understand the computing process.

can you explaine it in detail,why tanspose,why reshape?

BTW,in the paper, you say Ci=1,but in code it seems to be 32?

or,can you introduce some material for study to help me understand the process?

How to display the predicted result graph?

Thanks a lot for sharing!
I've got four files to output: checkpoint/data-00000-of-00001/index/meta.
But I cannot get the predictive graph to show up.
Could you please tell me how to display the predicted result graph?

为什么 windows10运行程序中的main.py 总是报错UnboundLocalError:赋值前引用的局部变量W,希望指点。

D:\Anaconda\envs\tensorflow-gpu\python.exe D:/PycharmProjects/STGCN_IJCAI-18/STGCN_IJCAI-18-master/main.py
2021-03-10 11:39:36.031711: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
2021-03-10 11:39:37.332511: I tensorflow/core/platform/cpu_feature_guard.cc:143] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2021-03-10 11:39:37.338870: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x287b22ae980 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2021-03-10 11:39:37.339049: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
2021-03-10 11:39:37.339710: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll
2021-03-10 11:39:37.362410: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: GeForce GTX 1050 Ti computeCapability: 6.1
coreClock: 1.392GHz coreCount: 6 deviceMemorySize: 4.00GiB deviceMemoryBandwidth: 104.43GiB/s
2021-03-10 11:39:37.362663: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
2021-03-10 11:39:37.365917: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_10.dll
2021-03-10 11:39:37.368303: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cufft64_10.dll
2021-03-10 11:39:37.369087: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library curand64_10.dll
2021-03-10 11:39:37.372096: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusolver64_10.dll
2021-03-10 11:39:37.373803: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_10.dll
2021-03-10 11:39:37.381498: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll
2021-03-10 11:39:37.381689: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1703] Adding visible gpu devices: 0
2021-03-10 11:39:37.845596: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1102] Device interconnect StreamExecutor with strength 1 edge matrix:
2021-03-10 11:39:37.845754: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1108] 0
2021-03-10 11:39:37.845836: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1121] 0: N
2021-03-10 11:39:37.846049: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1247] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 2988 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
2021-03-10 11:39:37.848793: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x287d618f8c0 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:
2021-03-10 11:39:37.848965: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): GeForce GTX 1050 Ti, Compute Capability 6.1
Training configs: Namespace(batch_size=50, epoch=50, graph='default', inf_mode='merge', ks=3, kt=3, lr=0.001, n_his=12, n_pred=9, n_route=228, opt='RMSProp', save=10)
ERROR: input file was not found in ./dataset\PeMSD7_W_228.csv.
Traceback (most recent call last):
File "D:/PycharmProjects/STGCN_IJCAI-18/STGCN_IJCAI-18-master/main.py", line 52, in
W = weight_matrix(pjoin('./dataset', f'PeMSD7_W_{n}.csv'))
File "D:\PycharmProjects\STGCN_IJCAI-18\STGCN_IJCAI-18-master\utils\math_graph.py", line 87, in weight_matrix
if set(np.unique(W)) == {0, 1}:
UnboundLocalError: local variable 'W' referenced before assignment

Process finished with exit code 1

change variables

Hi, thank you for sharing this neural network. I'm trying to apply this to the ChemE data and actually our data are kinda different! I though that I need to rewrite the data pre-processing part in main.py and like weight matrix definition in math_graph. I will change other basic arguments as well (mentioned in main.py).
I wonder that should I rewrite other part of this code which I've missed or ignored for the new data?
bc I did rewrite it actually, ummm.. it still didn't work!
Thanks for patience :)

How can I get the road network data

Hello,
I'd like to know how can I get the road topology network from PeMS dataset. Or did you build the network yourself? Besides, What the difference between the "station" and "link" in PeMS dataset? Thank you!

Computing Weighted Adjacency Matrix and replicate results

Hello Haoteng,

thank you for sharing the code for your paper, which I am studying:

I understood the big picture, and given the level of my mathematical background, I want to help myself with code step by step for a deeper understanding.

As first thing, I would like to be able run your code, and replicate results.

Could you please go through your code and point out the main functions to replicate results in your paper ?

I am using Colab virtual environment, I downloaded dataset from :
http://pems.dot.ca.gov

to be clear, they are this kind of files:
d07_text_station_5min_2019_01_02.txt.gz

which is in the form of :

['05/27/2012 00:00:00' 715898 7 5 'S' 'ML' 0.43 0 0 245.0 0.096 54.3 0
  86.0 0.0794 60.6 0 0.0 92.0 0.0852 53.0 0 0.0 67.0 0.1233 48.2 0 nan
  nan nan nan 0 nan nan nan nan 0 nan nan nan nan 0 nan nan nan nan 0 nan
  nan nan nan 0] ...  ]

Can you tell how do you manipulate them to format raw data as:

PeMSD7_V_{%num_route%}.csv : Historical Speed Records with shape of [len_seq * num_road] (len_seq = day_slot * num_dates).
PeMSD7_W_{%num_route%}.csv :

If I run a plain python main.py it will yield error, for it is not the W matrix that it is expecting. How to compute W from raw data? Should it be pre-processed separately or is it handled in your code somewhere ?

Possible to provide a quick reference for the code?

Thank you!

InvalidArgumentError: Nan in summary histogram for: stn_block_1_in/summaries/histogram_theta

Hello, have you ever encountered this problem?

tensorflow.python.framework.errors_impl.InvalidArgumentError: Nan in summary histogram for: stn_block_1_in/summaries/histogram_theta
         [[{{node stn_block_1_in/summaries/histogram_theta}}]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 82, in <module>
    model_train(PeMS, blocks, args)
    summary, _ = sess.run([merged, train_op], feed_dict={x: x_batch[:, 0:n_his + 1, :, :], keep_prob: 1.0})

About adjacency matrix

Hello, I read your paper and was cofused by the dataset PeMSD7's adjacency matrix.
Accoring to the formula:
image
And the W_ss8.csv:
image
I found that most of wij is a*10^3, for example, the matrix[0,1]=3165.94, let 3165.94 = exp(-dij^2/δ^2),it seems that it is impossible. What is the matter?

Data visualization

How can I extract the predicted values for comparison with the real values of the testing data. I am having some errors with TensorBoard and reading the event file (any guidance would be appreciated). Otherwise I think I can save the predictions in a list and save as CSV file.

Why does the adjacency matrix for PEMS-M only have 32 value greater 0?

Hello :)
I'm trying to implement the PEMS-M dataset for my models which is similar to your model.
I had a look at the adjacency matrix and I have notices that there are only 32 values greater 0.
I think that is too little for 228 nodes.
Maybe I just have missed some information.
Thank you in advance for your reply.

Best wishes!

Academic Question

On the assumption that the weight adjacent matrix is varying to frame but deterministic, could you analyze
what will happen on the performance of ST_GCN? In other words, how important to the performance of ST_GCN is the static weight adjacent matrix?

About first_approx()

In the function def first_approx(W, n):
Why do you use np.mat(np.identity(n) + sinvD * A * sinvD) as a result?
Refer to the Eq.5, I think there should not add np.identity(n),because the matrix A has already add the identity matrix in A = W + np.identity(n)
Looking forward to your reply,Thank you.

Predict diference data

Hello, Mr.Yin

After training and testing, I want to make predictions.
How can I use your model to predict a specified time?

If you have the code, please provide it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.