From 9eafa549291f707837940243b7302ce552eaaa20 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 17 Jan 2017 21:58:13 +0100 Subject: Change hierarchy. --- config/condlstm.py | 8 ++++---- model/condlstm.py | 5 ++--- 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) -- cgit v1.2.3