taxi

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

bidirectional_window_1.py (921B)


      1 import os
      2 import cPickle
      3 
      4 from blocks.algorithms import Momentum
      5 from blocks.initialization import IsotropicGaussian, Constant
      6 
      7 import data
      8 from model.bidirectional_tgtcls import Model, Stream
      9 
     10 
     11 with open(os.path.join(data.path, 'arrival-clusters.pkl')) as f: tgtcls = cPickle.load(f)
     12 
     13 dim_embeddings = [
     14     ('origin_call', data.origin_call_train_size, 10),
     15     ('origin_stand', data.stands_size, 10),
     16     ('week_of_year', 52, 10),
     17     ('day_of_week', 7, 10),
     18     ('qhour_of_day', 24 * 4, 10),
     19     ('taxi_id', data.taxi_id_size, 10),
     20 ]
     21 
     22 hidden_state_dim = 100
     23 
     24 dim_hidden = [500, 500]
     25 
     26 embed_weights_init = IsotropicGaussian(0.01)
     27 weights_init = IsotropicGaussian(0.1) 
     28 biases_init = Constant(0.01)
     29 
     30 batch_size = 400
     31 batch_sort_size = 20
     32 
     33 max_splits = 100
     34 train_max_len = 500
     35 
     36 window_size = 5
     37 
     38 # monitor_freq = 10000 # temporary, for finding good learning rate
     39 
     40 # step_rule= Momentum(learning_rate=0.001, momentum=0.9)
     41