All Projects → wuhao5688 → Rnn Trajmodel

wuhao5688 / Rnn Trajmodel

The source of the IJCAI2017 paper "Modeling Trajectory with Recurrent Neural Networks"

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Rnn Trajmodel

Rmdl
RMDL: Random Multimodel Deep Learning for Classification
Stars: ✭ 375 (+420.83%)
Mutual labels:  deep-neural-networks, recurrent-neural-networks
Keras Attention
Visualizing RNNs using the attention mechanism
Stars: ✭ 697 (+868.06%)
Mutual labels:  deep-neural-networks, recurrent-neural-networks
First Steps Towards Deep Learning
This is an open sourced book on deep learning.
Stars: ✭ 376 (+422.22%)
Mutual labels:  deep-neural-networks, recurrent-neural-networks
Hey Jetson
Deep Learning based Automatic Speech Recognition with attention for the Nvidia Jetson.
Stars: ✭ 161 (+123.61%)
Mutual labels:  deep-neural-networks, recurrent-neural-networks
Sangita
A Natural Language Toolkit for Indian Languages
Stars: ✭ 43 (-40.28%)
Mutual labels:  deep-neural-networks, recurrent-neural-networks
Pytorch Kaldi
pytorch-kaldi is a project for developing state-of-the-art DNN/RNN hybrid speech recognition systems. The DNN part is managed by pytorch, while feature extraction, label computation, and decoding are performed with the kaldi toolkit.
Stars: ✭ 2,097 (+2812.5%)
Mutual labels:  deep-neural-networks, recurrent-neural-networks
Trending Deep Learning
Top 100 trending deep learning repositories sorted by the number of stars gained on a specific day.
Stars: ✭ 543 (+654.17%)
Mutual labels:  deep-neural-networks, recurrent-neural-networks
Pytorch Learners Tutorial
PyTorch tutorial for learners
Stars: ✭ 97 (+34.72%)
Mutual labels:  deep-neural-networks, recurrent-neural-networks
Theano Kaldi Rnn
THEANO-KALDI-RNNs is a project implementing various Recurrent Neural Networks (RNNs) for RNN-HMM speech recognition. The Theano Code is coupled with the Kaldi decoder.
Stars: ✭ 31 (-56.94%)
Mutual labels:  deep-neural-networks, recurrent-neural-networks
Zoneout Tensorflow
An implementation of zoneout regularizer on LSTM-RNN by Tensorflow
Stars: ✭ 23 (-68.06%)
Mutual labels:  deep-neural-networks, recurrent-neural-networks
Arc Pytorch
The first public PyTorch implementation of Attentive Recurrent Comparators
Stars: ✭ 147 (+104.17%)
Mutual labels:  deep-neural-networks, recurrent-neural-networks
Gdax Orderbook Ml
Application of machine learning to the Coinbase (GDAX) orderbook
Stars: ✭ 60 (-16.67%)
Mutual labels:  deep-neural-networks, recurrent-neural-networks
Top Deep Learning
Top 200 deep learning Github repositories sorted by the number of stars.
Stars: ✭ 1,365 (+1795.83%)
Mutual labels:  deep-neural-networks, recurrent-neural-networks
Hdltex
HDLTex: Hierarchical Deep Learning for Text Classification
Stars: ✭ 191 (+165.28%)
Mutual labels:  deep-neural-networks, recurrent-neural-networks
Mad Twinnet
The code for the MaD TwinNet. Demo page:
Stars: ✭ 99 (+37.5%)
Mutual labels:  deep-neural-networks, recurrent-neural-networks
Ner Lstm
Named Entity Recognition using multilayered bidirectional LSTM
Stars: ✭ 532 (+638.89%)
Mutual labels:  deep-neural-networks, recurrent-neural-networks
Deep Learning Time Series
List of papers, code and experiments using deep learning for time series forecasting
Stars: ✭ 796 (+1005.56%)
Mutual labels:  deep-neural-networks, recurrent-neural-networks
Deepseqslam
The Official Deep Learning Framework for Route-based Place Recognition
Stars: ✭ 49 (-31.94%)
Mutual labels:  deep-neural-networks, recurrent-neural-networks
Bitcoin Price Prediction Using Lstm
Bitcoin price Prediction ( Time Series ) using LSTM Recurrent neural network
Stars: ✭ 67 (-6.94%)
Mutual labels:  deep-neural-networks, recurrent-neural-networks
Pytorch Attention Guided Cyclegan
Pytorch implementation of Unsupervised Attention-guided Image-to-Image Translation.
Stars: ✭ 67 (-6.94%)
Mutual labels:  deep-neural-networks

Modeling Trajectory with Recurrent Neural Networks

The source code of my paper.

Hao Wu, Ziyang Chen, Weiwei Sun, Baihua Zheng, Wei Wang, Modeling Trajectories with Recurrent Neural Networks. IJCAI 2017

Directory Structure

The directory structure may be as follows

workspace (e.g., /data)
    └ dataset_name1 (e.g., porto_6k)
        ├ data
        |   └ your_traj_file.txt
        ├ map
        |   ├ nodeOSM.txt
        |   └ edgeOSM.txt
        └ ckpt
            └ CSSRNN
                ├ dest_emb
                |   └ emb_50_hid_50_deep_1
                ├ dest_coord
                |   └ emb_200_hid_50_deep_1
                └ without_dest
                    └ emb_250_hid_350_deep_3

  
codespace
    ├ config
    ├ main.py
    ├ geo.py
    ├ trajmodel.py
    └ ngram_model.py
    

Format of the Data

Map/road network data

The map is recommended to be constructed from OpenStreetMap. You can get your own road network file from OpenStreetMap by selecting the rectangle area and export the file by, say, Overpass API (the first choice in the web page). Then you will be prompted to download a data named map which is actually an XML-formatted file. To parse the raw map data, you can use the tool here. After successfully parsed the raw map data, the nodeOSM.txt and edgeOSM.txt will be automatically extracted. The format of these two files are shown as follows.

nodeOSM.txt

Format: [NodeID]\t[latitude]\t[longitude]

One node/vertex per line with increasing (continuous) ids. E.g.,

0   41.1689665  -8.6444747
1   41.1658735  -8.6444774
2   41.1670798  -8.6424338
3   41.1673856  -8.642543
4   41.1669776  -8.6417132
5   41.1676312  -8.6424866
...
1000   41.1575375  -8.6443184

, which records 1,000 vertices in the road network.

edgeOSM.txt

Format: [EdgeId]\t[StartNodeId]\t[EndNodeId]\t[k]\t[lat1]\t[lon1]\t[lat2]\t[lon2]...\t[latk]\t[lonk]

One edge (StartNode -> EndNode) per line with increasing (continuous) ids. And k refers to the number of points of a polyline representing the shape of the road (including the start and the end node). I.e., (lat1, lon1) is just the coordinate of StartNode, and (latk, lonk) is the coordinate of EndNode.

E.g.,

0   0   1326    5   41.1689665  -8.6444747  41.1688112  -8.6443785  41.1685579  -8.6440804  41.1683059  -8.6438068  41.1680768  -8.6437482
1   4   5   2   41.1669776  -8.6417132  41.1676312  -8.6424866
...
1500    1499    1494    2   41.1849529  -8.6317477  41.185196   -8.6318118

, which records 1,500 edges in the road network. Edge 0 represents an edge from node 0 to node 1326 with 5 points representing the shape of the road as a polyline. And edge 1 represents an edge from node 4 to 5 with 2 points representing the shape, which means the shape of this road is a straight line segment (i.e., the first point(41.1669776, -8.6417132) is just the coordinate of node 4 and the second point (41.1676312, -8.6424866) is just the coordinate of node 5).

Trajectory data

The format of trajectory data is very simple. The data may like as follows,

1,2,4,6,8,12,7,23,
9,2,4,18,76,42,3,78,98,54,
432,214,678,532,3,5,74,13,123,67,4,
...

Each line records several edge ids in the road network, which represents a trajectory w.r.t. the definition introduced in the paper, i.e.,

Definition 2 (Trajectory). A trajectory T in the form of r_1 → r_2 → … → r_k captures the movement of an object from r_1 to r_2 and so on to r_k along the road network G, where every two consecutive road segments are connected, i.e., \forall r_i, r_{i+1} ∈ T, r_i, r_{i+1}∈ E ∧ r_i.e = r_{i+1}.s.

The trajectory (route) is generated by the HMM map matching algorithm Hidden Markov Map Matching Through Noise and Sparseness using the raw GPS trajectory data (sequence of coordinates, geographical coordinate should be transferred into rectangular coordiante). The kernel code is implemented in C++ (see HMM_mapmatching.cpp). There remain some function to be implemented by your own. For more detail, please refer to the comments in HMM_mapmatching.cpp.

Environment and Package Dependencies

The code can be successfully run under following environments

  • Python: py2/py3 compatible
  • Tensorflow version: 12.0 (You may have to change some code if you want to use higher version of Tensorflow since some APIs have been changed after v1.0)
  • OS: Linux (I've tried this code on Windows and there may occur some strange runtime problems.)

[TODO] I'll modify some code to make it compatible with newest API of Tensorflow.

The project will also need following package dependencies

  • Numpy
  • Matplotlib

Usage

  • Put the codes and the config file into the code space. Leave the trajectory data and the map data in the workspace following the directory structure as above.
  • Modify config file
  • Run main function in main.py

Details of configuration

All model settings are included in config file or can be set through the instance of Config class. To run the model, the following settings are important and should be set according to your own dataset.

  • dataset_name: give a name to your own dataset and put all stuffs w.r.t. this dataset into the directory named by this name (as the directory tree structure in the above section).
  • workspace: the place you want to put all data in, e.g. \home\data. Note that you may have several datasets, e.g., with the names being, dataset1, dataset2, ... . The directory may like as follows,
/home/data/dataset1/data
/home/data/dataset1/map
/home/data/dataset1/ckpt
 
/home/data/dataset2/data
/home/data/dataset2/map
/home/data/dataset2/ckpt
...
  • file_name: set this as the name of your own trajectory file. If you follow the directory tree sturcture as above, you may set the file_name as data/trajectory.txt since the file is located in the data/ directory.

If you have correctly set these fields in the config, the model will be able to run with configuration printed in the screen.

To get the details of the remaining attributes of config, please refer to main.py. Each field is described in detail in comments.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].