summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2017-01-17 21:58:13 +0100
committerAlex Auvolat <alex@adnab.me>2017-01-17 21:58:13 +0100
commit9eafa549291f707837940243b7302ce552eaaa20 (patch)
tree51823241f10d9b399ef139ab9ac090d3e3be4af3
parent2a4f89c41b82e7173d6fb4481af0dcd58c812c19 (diff)
downloadtext-rnn-9eafa549291f707837940243b7302ce552eaaa20.tar.gz
text-rnn-9eafa549291f707837940243b7302ce552eaaa20.zip
Change hierarchy.
-rw-r--r--config/condlstm.py8
-rw-r--r--model/condlstm.py5
2 files changed, 6 insertions, 7 deletions
diff --git a/config/condlstm.py b/config/condlstm.py
index f846972..027c2a9 100644
--- a/config/condlstm.py
+++ b/config/condlstm.py
@@ -19,11 +19,11 @@ layers = [
'reset_after': ' \t\n,.:;/!?()[]{}<>\\\'"*+-^_|#~&`@$%',
},
{'dim': 128,
- 'run_on': ' \t\n,.:;/!?()[]{}<>\\\'"*+-^_|#~&`@$%',
+ 'run_on': ' \t\n,.:;/!?()[]{}<>\\\'"*+-^_|#~&`@$%aiueoAIUEO',
'reset_after': ' \t\n',
},
{'dim': 128,
- 'run_on': ' \t\n',
+ 'run_on': ' \t\n,.:;/!?()[]{}<>\\\'"*+-^_|#~&`@$%',
'reset_after': '\t\n',
},
{'dim': 256,
@@ -46,11 +46,11 @@ layers = [
'reset_before':'\n',
},
{'dim': 128,
- 'run_on': ' \t\n',
+ 'run_on': ' \t\n,.:;/!?()[]{}<>\\\'"*+-^_|#~&`@$%',
'reset_before': '\t\n',
},
{'dim': 128,
- 'run_on': ' \t\n,.:;/!?()[]{}<>\\\'"*+-^_|#~&`@$%',
+ 'run_on': ' \t\n,.:;/!?()[]{}<>\\\'"*+-^_|#~&`@$%aiueoAIUEO',
'reset_before': ' \t\n',
},
{'dim': 128,
diff --git a/model/condlstm.py b/model/condlstm.py
index 1d62b0a..26d9582 100644
--- a/model/condlstm.py
+++ b/model/condlstm.py
@@ -10,7 +10,7 @@ from blocks.roles import WEIGHT
from blocks.graph import ComputationGraph, apply_noise, apply_dropout
-class CondLSTM(LSTM):
+class RstLSTM(LSTM):
@recurrent(sequences=['inputs', 'run_mask', 'rst_in_mask', 'rst_out_mask'],
states=['states', 'cells'],
contexts=[], outputs=['states', 'cells', 'outputs'])
@@ -24,7 +24,6 @@ class CondLSTM(LSTM):
states, cells = self.apply(iterate=False,
inputs=inputs, states=states, cells=cells,
mask=run_mask)
-
outputs = states
if rst_out_mask:
@@ -69,7 +68,7 @@ class Model():
bricks.append(linear)
inter = linear.apply(recvalues[:, :, :indim])
- lstm = CondLSTM(dim=p['dim'], activation=config.activation_function,
+ lstm = RstLSTM(dim=p['dim'], activation=config.activation_function,
name="lstm_rec_%d"%i)
bricks.append(lstm)