diff options
author | Étienne Simon <esimon@esimon.eu> | 2015-07-21 18:26:43 -0400 |
---|---|---|
committer | Étienne Simon <esimon@esimon.eu> | 2015-07-21 18:27:55 -0400 |
commit | e1673538607a7c8d784013b21b753f0c05c4cc34 (patch) | |
tree | f42e316e0c5bf67e3c9953aad6ba8fe9656829f2 /config | |
parent | 58dcf7b17e9db6af53808994a7d39a759fcc5028 (diff) | |
download | taxi-e1673538607a7c8d784013b21b753f0c05c4cc34.tar.gz taxi-e1673538607a7c8d784013b21b753f0c05c4cc34.zip |
Genericize RNNs
Diffstat (limited to 'config')
-rw-r--r-- | config/rnn_1.py | 2 | ||||
-rw-r--r-- | config/rnn_lag_tgtcls_1.py | 49 | ||||
-rw-r--r-- | config/rnn_tgtcls_1.py | 37 |
3 files changed, 87 insertions, 1 deletions
diff --git a/config/rnn_1.py b/config/rnn_1.py index 5bc62d8..6e148c4 100644 --- a/config/rnn_1.py +++ b/config/rnn_1.py @@ -1,7 +1,7 @@ from blocks.initialization import IsotropicGaussian, Constant import data -from model.rnn import Model, Stream +from model.rnn_direct import Model, Stream class EmbedderConfig(object): __slots__ = ('dim_embeddings', 'embed_weights_init') diff --git a/config/rnn_lag_tgtcls_1.py b/config/rnn_lag_tgtcls_1.py new file mode 100644 index 0000000..7a41b70 --- /dev/null +++ b/config/rnn_lag_tgtcls_1.py @@ -0,0 +1,49 @@ +import os +import cPickle + +from blocks import roles +from blocks.bricks import Rectifier +from blocks.filter import VariableFilter +from blocks.initialization import IsotropicGaussian, Constant + +import data +from model.rnn_lag_tgtcls import Model, Stream + +class EmbedderConfig(object): + __slots__ = ('dim_embeddings', 'embed_weights_init') + +pre_embedder = EmbedderConfig() +pre_embedder.embed_weights_init = IsotropicGaussian(0.001) +pre_embedder.dim_embeddings = [ + ('week_of_year', 52, 10), + ('day_of_week', 7, 10), + ('qhour_of_day', 24 * 4, 10), + ('day_type', 3, 10), + ('taxi_id', 448, 10), +] + +post_embedder = EmbedderConfig() +post_embedder.embed_weights_init = IsotropicGaussian(0.001) +post_embedder.dim_embeddings = [ + ('origin_call', data.origin_call_train_size, 10), + ('origin_stand', data.stands_size, 10), +] + +with open(os.path.join(data.path, 'arrival-clusters.pkl')) as f: tgtcls = cPickle.load(f) + +hidden_state_dim = 100 +weights_init = IsotropicGaussian(0.01) +biases_init = Constant(0.001) + +rec_to_out_dims = [200, 1000] +in_to_rec_dims = [200] + +dropout = 0.5 +dropout_inputs = VariableFilter(bricks=[Rectifier], name='output') + +noise = 0.01 +noise_inputs = VariableFilter(roles=[roles.PARAMETER]) + +batch_size = 10 +batch_sort_size = 10 +valid_set = 'cuts/test_times_0' diff --git a/config/rnn_tgtcls_1.py b/config/rnn_tgtcls_1.py new file mode 100644 index 0000000..3204559 --- /dev/null +++ b/config/rnn_tgtcls_1.py @@ -0,0 +1,37 @@ +import os +import cPickle + +from blocks.initialization import IsotropicGaussian, Constant + +import data +from model.rnn_tgtcls import Model, Stream + +class EmbedderConfig(object): + __slots__ = ('dim_embeddings', 'embed_weights_init') + +pre_embedder = EmbedderConfig() +pre_embedder.embed_weights_init = IsotropicGaussian(0.001) +pre_embedder.dim_embeddings = [ + ('week_of_year', 52, 10), + ('day_of_week', 7, 10), + ('qhour_of_day', 24 * 4, 10), + ('day_type', 3, 10), + ('taxi_id', 448, 10), +] + +post_embedder = EmbedderConfig() +post_embedder.embed_weights_init = IsotropicGaussian(0.001) +post_embedder.dim_embeddings = [ + ('origin_call', data.origin_call_train_size, 10), + ('origin_stand', data.stands_size, 10), +] + +with open(os.path.join(data.path, 'arrival-clusters.pkl')) as f: tgtcls = cPickle.load(f) + +hidden_state_dim = 100 +weights_init = IsotropicGaussian(0.01) +biases_init = Constant(0.001) + +batch_size = 10 +batch_sort_size = 10 +valid_set = 'cuts/test_times_0' |