Пример #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
Пример #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
Пример #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
Пример #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
Пример #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