taxi

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

rnn_1.py (838B)


      1 from blocks.initialization import IsotropicGaussian, Constant
      2 
      3 import data
      4 from model.rnn_direct import Model, Stream
      5 
      6 class EmbedderConfig(object):
      7     __slots__ = ('dim_embeddings', 'embed_weights_init')
      8 
      9 pre_embedder = EmbedderConfig()
     10 pre_embedder.embed_weights_init = IsotropicGaussian(0.001)
     11 pre_embedder.dim_embeddings = [ 
     12     ('week_of_year', 52, 10),
     13     ('day_of_week', 7, 10),
     14     ('qhour_of_day', 24 * 4, 10),
     15     ('day_type', 3, 10),
     16     ('taxi_id', 448, 10),
     17 ]
     18 
     19 post_embedder = EmbedderConfig()
     20 post_embedder.embed_weights_init = IsotropicGaussian(0.001)
     21 post_embedder.dim_embeddings = [ 
     22     ('origin_call', data.origin_call_train_size, 10), 
     23     ('origin_stand', data.stands_size, 10),
     24 ]
     25 
     26 
     27 hidden_state_dim = 100 
     28 weights_init = IsotropicGaussian(0.01)
     29 biases_init = Constant(0.001)
     30 
     31 batch_size = 10
     32 batch_sort_size = 10