taxi

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

dest_mlp_tgtcls_0_cs.py (785B)


      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 ]
     18 
     19 dim_input = n_begin_end_pts * 2 * 2 + sum(x for (_, _, x) in dim_embeddings)
     20 dim_hidden = []
     21 dim_output = tgtcls.shape[0]
     22 
     23 embed_weights_init = IsotropicGaussian(0.001)
     24 mlp_weights_init = IsotropicGaussian(0.01)
     25 mlp_biases_init = Constant(0.001)
     26 
     27 learning_rate = 0.0001
     28 momentum = 0.99
     29 batch_size = 32
     30 
     31 max_splits = 100