dest_mlp_tgtcls_1_cswdtx.py (960B)
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 ('taxi_id', 448, 10), 22 ] 23 24 dim_input = n_begin_end_pts * 2 * 2 + sum(x for (_, _, x) in dim_embeddings) 25 dim_hidden = [500] 26 dim_output = tgtcls.shape[0] 27 28 embed_weights_init = IsotropicGaussian(0.001) 29 mlp_weights_init = IsotropicGaussian(0.01) 30 mlp_biases_init = Constant(0.001) 31 32 learning_rate = 0.0001 33 momentum = 0.99 34 batch_size = 100 35 36 use_cuts_for_training = True 37 max_splits = 1