taxi

Winning entry to the Kaggle taxi competition
git clone https://esimon.eu/repos/taxi.git
Log | Files | Refs | README

dest_mlp_tgtcls_1_cswdt.py (906B)


      1 import os
      2 import cPickle
      3 
      4 from blocks.initialization import IsotropicGaussian, Constant
      5 
      6 import data
      7 from model.dest_mlp_tgtcls import Model, Stream
      8 
      9 
     10 n_begin_end_pts = 5     # how many points we consider at the beginning and end of the known trajectory
     11 
     12 with open(os.path.join(data.path, 'arrival-clusters.pkl')) as f: tgtcls = cPickle.load(f)
     13 
     14 dim_embeddings = [
     15     ('origin_call', data.origin_call_train_size, 10),
     16     ('origin_stand', data.stands_size, 10),
     17     ('week_of_year', 52, 10),
     18     ('day_of_week', 7, 10),
     19     ('qhour_of_day', 24 * 4, 10),
     20     ('day_type', 3, 10),
     21 ]
     22 
     23 dim_input = n_begin_end_pts * 2 * 2 + sum(x for (_, _, x) in dim_embeddings)
     24 dim_hidden = [500]
     25 dim_output = tgtcls.shape[0]
     26 
     27 embed_weights_init = IsotropicGaussian(0.001)
     28 mlp_weights_init = IsotropicGaussian(0.01)
     29 mlp_biases_init = Constant(0.001)
     30 
     31 learning_rate = 0.0001
     32 momentum = 0.99
     33 batch_size = 32
     34 
     35 max_splits = 100