aboutsummaryrefslogtreecommitdiff
path: root/model/bidirectional.py
diff options
context:
space:
mode:
authorÉtienne Simon <esimon@esimon.eu>2015-07-27 13:07:19 -0400
committerÉtienne Simon <esimon@esimon.eu>2015-07-27 13:07:19 -0400
commit9933cafdf3b218a509c2efd6e6e6ba91ae87aa9c (patch)
treed696681c2b5a73424bdd226b8c9e385b2580acd7 /model/bidirectional.py
parent0021c3fb99d1cd3f8792a8cf5c35548815536428 (diff)
downloadtaxi-9933cafdf3b218a509c2efd6e6e6ba91ae87aa9c.tar.gz
taxi-9933cafdf3b218a509c2efd6e6e6ba91ae87aa9c.zip
Add bidirectional with recurrent ReLu
Diffstat (limited to 'model/bidirectional.py')
-rw-r--r--model/bidirectional.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/model/bidirectional.py b/model/bidirectional.py
index 4c4ffb0..5779752 100644
--- a/model/bidirectional.py
+++ b/model/bidirectional.py
@@ -37,7 +37,8 @@ class BidiRNN(Initializable):
self.context_embedder = ContextEmbedder(config)
- self.rec = SegregatedBidirectional(LSTM(dim=config.hidden_state_dim, name='recurrent'))
+ act = config.rec_activation() if hasattr(config, 'rec_activation') else None
+ self.rec = SegregatedBidirectional(LSTM(dim=config.hidden_state_dim, activation=act, name='recurrent'))
self.fwd_fork = Fork([name for name in self.rec.prototype.apply.sequences if name!='mask'],
prototype=Linear(), name='fwd_fork')