Esempio n. 1
0
 def __init__(self, params, mode, name):
   GraphModule.__init__(self, name)
   Configurable.__init__(self, params, mode)
   self.params["rnn_cell"] = _toggle_dropout(self.params["rnn_cell"], mode)
   self.cell = training_utils.get_rnn_cell(**self.params["rnn_cell"])
   # Not initialized yet
   self.initial_state = None
   self.helper = None
Esempio n. 2
0
 def __init__(self, params, mode, name):
   GraphModule.__init__(self, name)
   Configurable.__init__(self, params, mode)
   self.params["rnn_cell"] = _toggle_dropout(self.params["rnn_cell"], mode)
   self.cell = training_utils.get_rnn_cell(**self.params["rnn_cell"])
   # Not initialized yet
   self.initial_state = None
   self.helper = None
Esempio n. 3
0
    def __init__(self, params, mode, name):
        GraphModule.__init__(self, name)
        Configurable.__init__(self, params, mode)

        self.params["rnn_cell"] = _toggle_dropout(
            self.params["rnn_cell"],
            ["dropout_input_keep_prob", "dropout_output_keep_prob"], mode)
        self.params["dropout_decoder"] = _toggle_dropout(
            self.params["dropout_decoder"], ["dropout_deep_output_layer"],
            mode)

        with tf.variable_scope("rec1"):
            self.cell_rec1 = training_utils.get_rnn_cell(
                **self.params["rnn_cell"])
        with tf.variable_scope("rec2"):
            self.cell_rec2 = training_utils.get_rnn_cell(
                **self.params["rnn_cell"])

        # Not initialized yet
        self.initial_state = None
        self.helper = None