From 7dab7e47ce0e8c5ae996821794450a9ad3186cd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Simon?= Date: Fri, 24 Jul 2015 16:09:48 -0400 Subject: Fix memory network --- model/memory_network_bidir.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'model/memory_network_bidir.py') diff --git a/model/memory_network_bidir.py b/model/memory_network_bidir.py index cc99312..81e6440 100644 --- a/model/memory_network_bidir.py +++ b/model/memory_network_bidir.py @@ -72,22 +72,25 @@ class RecurrentEncoder(Initializable): return outputs + @apply.property('inputs') + def apply_inputs(self): + return self.inputs + class Model(MemoryNetworkBase): def __init__(self, config, **kwargs): # Build prefix encoder : recurrent then MLP - prefix_encoder = RecurrentEncoder(self.config.prefix_encoder, - self.config.representation_size, - self.config.representation_activation(), + prefix_encoder = RecurrentEncoder(config.prefix_encoder, + config.representation_size, + config.representation_activation(), name='prefix_encoder') # Build candidate encoder - candidate_encoder = RecurrentEncoder(self.config.candidate_encoder, - self.config.representation_size, - self.config.representation_activation(), + candidate_encoder = RecurrentEncoder(config.candidate_encoder, + config.representation_size, + config.representation_activation(), name='candidate_encoder') # And... that's it! super(Model, self).__init__(config, prefix_encoder, candidate_encoder, **kwargs) - -- cgit v1.2.3