Ejemplo n.º 1
0
 def encoder_cell(self):
     """RNN cell for the encoder."""
     with tf.variable_scope("encoder_cell") as scope:
         cell = graph_utils.create_multilayer_cell(self.rnn_cell, scope,
                                                   self.dim, self.num_layers)
         self.encoder_cell_vars = True
     return cell, scope
Ejemplo n.º 2
0
 def forward_cell(self):
     """RNN cell for the forward RNN."""
     with tf.variable_scope("forward_cell") as scope:
         cell = graph_utils.create_multilayer_cell(self.rnn_cell, scope,
                                                   self.dim, self.num_layers,
                                                   self.encoder_input_keep, self.encoder_output_keep)
     return cell, scope
Ejemplo n.º 3
0
 def decoder_cell(self, scope):
     with tf.variable_scope(scope or "decoder_cell") as scope:
         cell = graph_utils.create_multilayer_cell(
             self.rnn_cell, scope, self.dim, self.num_layers,
             self.decoder_input_keep, self.decoder_output_keep)
         self.encoder_cell_vars = True
     return cell, scope
Ejemplo n.º 4
0
 def horizontal_cell(self):
     """Cell that controls transition from left sibling to right sibling."""
     with tf.variable_scope("horizontal_cell") as scope:
         cell = graph_utils.create_multilayer_cell(self.rnn_cell, scope,
                                                   self.dim, self.num_layers,
                                                   self.decoder_input_keep,
                                                   self.decoder_output_keep)
     return cell, scope
Ejemplo n.º 5
0
 def vertical_cell(self):
     """Cell that controls transition from parent to child."""
     with tf.variable_scope("vertical_cell") as scope:
         cell = graph_utils.create_multilayer_cell(self.rnn_cell, scope,
                                                   self.dim, self.num_layers,
                                                   self.decoder_input_keep,
                                                   self.decoder_output_keep)
     return cell, scope