Git Product home page Git Product logo

atfm's Introduction

Attentive Traffic Flow Machines

This is a PyTorch implementation of Attentive Traffic Flow Machines (ATFM). ATFM is a a unified neural network which can effectively learn the spatial-temporal feature representations of crowd flow with an attention mechanism.

If you use this code for your research, please cite our papers ๏ผˆConference Version and Journal Version):

@inproceedings{liu2018attentive,
  title={Attentive Crowd Flow Machines},
  author={Liu, Lingbo and Zhang, Ruimao and Peng, Jiefeng and Li, Guanbin and Du, Bowen and Lin, Liang},
  booktitle={2018 ACM Multimedia Conference on Multimedia Conference},
  pages={1553--1561},
  year={2018},
  organization={ACM}
}
@article{liu20120dynamic,
  title={Dynamic Spatial-Temporal Representation Learning for Traffic Flow Prediction},
  author={Liu, Lingbo and Zhen, Jiajie and Li, Guanbin and Zhan, Geng and He, Zhaocheng and Du, Bowen and Lin, Liang},
  journal={IEEE Transactions on Intelligent Transportation Systems},
  year={2020}
}

Requirements

  • torch==0.4.1

Preprocessing

For Crowd Flow Prediction: download TaxiBJ / BikeNYC and put them into folder data/TaxiBJ and data/BikeNYC.

For Citywide Passenger Demand Prediction (CPDP): the dataset of CPDP has been in folder data/TaxiNYC.

Model Training

# TaxiBJ
python run_taxibj.py

# BikeNYC
python run_bikenyc.py

# TaxiNYC
python run_taxinyc.py

Testing

# TaxiBJ
python test_taxibj.py

# BikeNYC
python test_bikenyc.py

# TaxiNYC
python test_taxinyc.py

atfm's People

Contributors

liulingbo918 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

Watchers

 avatar  avatar  avatar

atfm's Issues

For the TaxiBJ

Hi
It seems that TaxiBJ could not download from the url
Can you please provide other ways to download this dataset?
Thanks a lot

AttributeError: Can't pickle local object 'Dataset.load_data.<locals>.TempClass'

Good day,
Hope this met you well. I tried replication this result this is the error i am having, could you please help me out if possible?
Thank you

THE ERROR MESSAGE HERE
Preprocessing: Reading HDF5 file(s)
Dataset: BikeNYC
C:\Users\s324770\AppData\Local\Continuum\anaconda3\lib\site-packages\h5py_hl\dataset.py:313: H5pyDeprecationWarning: dataset.value has been deprecated. Use dataset[()] instead.
"Use dataset[()] instead.", H5pyDeprecationWarning)
before removing 4392
incomplete days: []
after removing 4392
Preprocessing: Min max normalizing
DataFetcher: With Length: 4, 2, 0; with Padding: 0 0, 0 0; with Interval: 1 7.
Dumped 0 data.
Set lr= 0.0003

AttributeError Traceback (most recent call last)
~\Dropbox\Implement2020\Codes\Attentive Crowd Flow Machines\run_bikenyc.py in
178 tconf = TrainConfiguration()
179
--> 180 run(dconf, tconf)

~\Dropbox\Implement2020\Codes\Attentive Crowd Flow Machines\run_bikenyc.py in run(dconf, tconf)
132
133 model.train()
--> 134 for i, (X, X_ext, Y, Y_ext) in enumerate(train_loader, 0):
135 X = X.cuda()
136 X_ext = X_ext.cuda()

~\AppData\Local\Continuum\anaconda3\lib\site-packages\torch\utils\data\dataloader.py in iter(self)
277 return _SingleProcessDataLoaderIter(self)
278 else:
--> 279 return _MultiProcessingDataLoaderIter(self)
280
281 @Property

~\AppData\Local\Continuum\anaconda3\lib\site-packages\torch\utils\data\dataloader.py in init(self, loader)
717 # before it starts, and del tries to join but will get:
718 # AssertionError: can only join a started process.
--> 719 w.start()
720 self._index_queues.append(index_queue)
721 self._workers.append(w)

~\AppData\Local\Continuum\anaconda3\lib\multiprocessing\process.py in start(self)
110 'daemonic processes are not allowed to have children'
111 _cleanup()
--> 112 self._popen = self._Popen(self)
113 self._sentinel = self._popen.sentinel
114 # Avoid a refcycle if the target function holds an indirect

~\AppData\Local\Continuum\anaconda3\lib\multiprocessing\context.py in _Popen(process_obj)
221 @staticmethod
222 def _Popen(process_obj):
--> 223 return _default_context.get_context().Process._Popen(process_obj)
224
225 class DefaultContext(BaseContext):

~\AppData\Local\Continuum\anaconda3\lib\multiprocessing\context.py in _Popen(process_obj)
320 def _Popen(process_obj):
321 from .popen_spawn_win32 import Popen
--> 322 return Popen(process_obj)
323
324 class SpawnContext(BaseContext):

~\AppData\Local\Continuum\anaconda3\lib\multiprocessing\popen_spawn_win32.py in init(self, process_obj)
87 try:
88 reduction.dump(prep_data, to_child)
---> 89 reduction.dump(process_obj, to_child)
90 finally:
91 set_spawning_popen(None)

~\AppData\Local\Continuum\anaconda3\lib\multiprocessing\reduction.py in dump(obj, file, protocol)
58 def dump(obj, file, protocol=None):
59 '''Replacement for pickle.dump() using ForkingPickler.'''
---> 60 ForkingPickler(file, protocol).dump(obj)
61
62 #

AttributeError: Can't pickle local object 'Dataset.load_data..TempClass'

spn-long

Hello! I did not find the spn-long model in github, only the spn model for short-term prediction. Could you please tell me where it is? Thank you!

Visualising results

Hi,
Thank you for the work. I have a question about TaxiBJ dataset. How do you visualise results? Also, why is there two different mse - inbound and outbound?

Please advise.

Thank you!

No Data

i am not able to find data from link that you provide [data is remove ] ( from where can find data Taxibj and bikeNyc)

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.