This is PyTorch implementation of MSTFCN in the following paper:
Multi-mode Spatial-Temporal Data Modeling with Fully Connected Networks. KSEM, 2024.
All datasets have been allocated in ./data/h5data/
folder.
-
Change model settings in
./model/{MODEL}/config.json
. -
Change running settings in
./config.json
.In
data
field,nyc-mix
,chicago-mix
andbeijing-mix
are available.Your can change
expid
field to name the experiments. -
Run
train_multi_step_mix.py
! -
Results will be saved in
./saves/{DATASET}/{MODEL}/{expid}
folder.
If you want to only inference trained models, run test_multi_step_mix.py
.
If you want to add more models:
-
Create a new directory in
./model/
, place youMYMODEL.py
and create aconfig.json
file to record your hyper-parameters. -
Register your model in
./model/__init__.py
and./util.py
.- If your model requires auxiliary information such as predefined graph, write it in
get_auxiliary()
function. - Init your model in
get_model()
function.
- If your model requires auxiliary information such as predefined graph, write it in
-
A little changes on the
forward()
function of your model:- The forward function of your model must be
forward(input, **kwargs)
. - The input has shape
(B, T, N, C + 2)
. The value of C is 4, with the first 2 entries refer to features of modality 1, and the last 2 entries refer to features of modality 2. - The remaining 2 refers to time semantic information
(B, T, N, 2)
. - The output must have shape
(B, T, N, C)
, without time semantic.
- The forward function of your model must be
-
Run!