diff options
author | Alex Auvolat <alex.auvolat@ens.fr> | 2015-05-22 10:00:15 -0400 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ens.fr> | 2015-05-22 10:00:15 -0400 |
commit | 39e549f05e568e4153381f025b3a0f256e9a7b7a (patch) | |
tree | 4e06cc45f359ad6a8cf4243fe7b42d01a23f7512 /model | |
parent | df50f103c1167f54a3ec04c1380fc95e4a023428 (diff) | |
download | taxi-39e549f05e568e4153381f025b3a0f256e9a7b7a.tar.gz taxi-39e549f05e568e4153381f025b3a0f256e9a7b7a.zip |
Make indexing faster by indexing only one column and querying a range
Diffstat (limited to 'model')
-rw-r--r-- | model/dest_simple_mlp_tgtcls.py | 2 | ||||
-rw-r--r-- | model/mlp.py | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/model/dest_simple_mlp_tgtcls.py b/model/dest_simple_mlp_tgtcls.py index 2d65097..46fca2b 100644 --- a/model/dest_simple_mlp_tgtcls.py +++ b/model/dest_simple_mlp_tgtcls.py @@ -9,7 +9,7 @@ from model.mlp import FFMLP, Stream class Model(FFMLP): def __init__(self, config, **kwargs): - super(Model, self, output_layer=Softmax).__init__(config, **kwargs) + super(Model, self).__init__(config, output_layer=Softmax, **kwargs) self.classes = theano.shared(numpy.array(config.tgtcls, dtype=theano.config.floatX), name='classes') @application(outputs=['destination']) diff --git a/model/mlp.py b/model/mlp.py index 576b45b..05898a5 100644 --- a/model/mlp.py +++ b/model/mlp.py @@ -1,6 +1,6 @@ from theano import tensor -from fuel.transformers import Batch +from fuel.transformers import Batch, MultiProcessing from fuel.streams import DataStream from fuel.schemes import ConstantScheme, ShuffledExampleScheme from blocks.bricks import application, MLP, Rectifier, Initializable @@ -63,7 +63,10 @@ class Stream(object): stream = transformers.TaxiAddDateTime(stream) stream = transformers.TaxiAddFirstLastLen(self.config.n_begin_end_pts, stream) stream = transformers.Select(stream, tuple(req_vars)) - return Batch(stream, iteration_scheme=ConstantScheme(self.config.batch_size)) + + stream = Batch(stream, iteration_scheme=ConstantScheme(self.config.batch_size)) + + return stream def valid(self, req_vars): stream = TaxiStream(self.config.valid_set, 'valid.hdf5') |