dest_mlp_1_cswdtx_alexandre.py (876B)
1 import os 2 import cPickle 3 4 from blocks.initialization import IsotropicGaussian, Constant 5 from blocks.algorithms import Momentum 6 7 import data 8 from model.dest_mlp import Model, Stream 9 10 11 n_begin_end_pts = 5 # how many points we consider at the beginning and end of the known trajectory 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 ('day_type', 3, 10), 20 ('taxi_id', 448, 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 = 2 26 27 embed_weights_init = IsotropicGaussian(0.01) 28 mlp_weights_init = IsotropicGaussian(0.1) 29 mlp_biases_init = Constant(0.01) 30 31 step_rule = Momentum(learning_rate=0.001, momentum=0.9) 32 33 batch_size = 200 34 35 max_splits = 100