da37438735fd4b845bb0874562bd071865c480bb,texar/modules/encoders/rnn_encoders.py,RNNEncoderBase,__init__,#RNNEncoderBase#Any#Any#Any#,49

Before Change


            if self._hparams.embedding.trainable:
                self._add_trainable_variable(self._embedding)
            if self._vocab_size is None:
                self._vocab_size = self._embedding.get_shape().as_list()[0]

    @staticmethod
    def default_hparams():
        Returns a dictionary of hyperparameters with default values.

After Change


        RNNEncoderBase.__init__(self, hparams)

        // Make RNN cells
        with tf.variable_scope(self.variable_scope):
            if cell_fw is not None:
                self._cell_fw = cell_fw
            else:
                self._cell_fw = layers.get_rnn_cell(self._hparams.rnn_cell_fw)

            if cell_bw is not None:
                self._cell_bw = cell_bw
            elif self.hparams.rnn_cell_share_config:
                self._cell_bw = layers.get_rnn_cell(self._hparams.rnn_cell_fw)
            else:
                self._cell_bw = layers.get_rnn_cell(self._hparams.rnn_cell_bw)

    @staticmethod
    def default_hparams():
        Returns a dictionary of hyperparameters with default values.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: asyml/texar
Commit Name: da37438735fd4b845bb0874562bd071865c480bb
Time: 2018-03-17
Author: zhitinghu@gmail.com
File Name: texar/modules/encoders/rnn_encoders.py
Class Name: RNNEncoderBase
Method Name: __init__


Project Name: asyml/texar
Commit Name: 42efaa53edce9b84a98fef1fce24502e6d2ba941
Time: 2017-12-08
Author: shore@pku.edu.cn
File Name: texar/modules/encoders/transformer_encoders.py
Class Name: TransformerEncoder
Method Name: __init__


Project Name: NVIDIA/OpenSeq2Seq
Commit Name: f791b89909d8ac69cac38610a4b1ed31d219920d
Time: 2018-08-01
Author: chipn@nvidia.com
File Name: open_seq2seq/encoders/lm_encoders.py
Class Name: AWDLSTMEncoder
Method Name: _encode