da37438735fd4b845bb0874562bd071865c480bb,texar/modules/encoders/rnn_encoders.py,RNNEncoderBase,__init__,#RNNEncoderBase#Any#Any#Any#,49
Before Change
self._vocab_size = vocab_size
self._embedding = None
if self._hparams.use_embedding:
if embedding is None and self._vocab_size is None:
raise ValueError(
"`vocab_szie` is required if embedding is enabled and "
"`embedding` is not provided")
if isinstance(embedding, tf.Variable):
self._embedding = embedding
else:
self._embedding = embedder_utils.get_embedding(
self._hparams.embedding, embedding, self._vocab_size,
self.variable_scope)
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():
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.
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
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: tensorlayer/tensorlayer
Commit Name: b2e6cccd53bd6c076c32421b8c4d562a96437524
Time: 2018-03-10
Author: dhsig552@163.com
File Name: tensorlayer/layers/normalization.py
Class Name: LayerNormLayer
Method Name: __init__
Project Name: GPflow/GPflow
Commit Name: 45fed420bcc3b0767b581b4ee804e0865e92a7a8
Time: 2018-06-28
Author: mikhailbeck@gmail.com
File Name: gpflow/training/scipy_optimizer.py
Class Name: ScipyOptimizer
Method Name: minimize