diff options
author | Joan Puigcerver <joapuipe@gmail.com> | 2016-07-01 18:48:25 +0300 |
---|---|---|
committer | Joan Puigcerver <joapuipe@gmail.com> | 2016-07-01 18:48:25 +0300 |
commit | cfdcc281a5bb9565c884e1c89f0840ffdb184001 (patch) | |
tree | def3be1ae23206437c1d1347eff68ca0952bea07 | |
parent | 977a25499624e055e76fca9ff255c2a1c2b0be19 (diff) |
Added dropout to rnn constructor, and new BGRU layer
-rw-r--r-- | BGRU.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/BGRU.lua b/BGRU.lua new file mode 100644 index 0000000..31d5d92 --- /dev/null +++ b/BGRU.lua @@ -0,0 +1,9 @@ +local BGRU, parent = torch.class('cudnn.BGRU', 'cudnn.RNN') + +function BGRU:__init(inputSize, hiddenSize, numLayers, batchFirst, dropout) + parent.__init(self, inputSize, hiddenSize, numLayers, batchFirst, dropout) + self.bidirectional = 'CUDNN_BIDIRECTIONAL' + self.mode = 'CUDNN_GRU' + self.numDirections = 2 + self:reset() +end |