791e7325a985bc8dd1a213c7cd1b1e888f934074,texar/modules/embedders/embedders.py,WordEmbedder,__init__,#WordEmbedder#Any#Any#Any#,50
Before Change
self._dropout_layer = None
if self._hparams.dropout_rate > 0.:
with tf.variable_scope(tf.variable_scope):
self._dropout_layer = tf.layers.Dropout(
rate=self._hparams.dropout_rate)
if self._hparams.trainable:
self._add_trainable_variable(self._embedding)
After Change
self._vocab_size = vocab_size
if vocab_size is None:
self._vocab_size = self._num_embeds
if self._vocab_size != self._num_embeds:
raise ValueError(
"vocab_size must equal to init_value.shape[0]."
"Got %d and %d" % (self._vocab_size, self._num_embeds))
self._built = True
@staticmethod
def default_hparams():
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: asyml/texar
Commit Name: 791e7325a985bc8dd1a213c7cd1b1e888f934074
Time: 2018-05-27
Author: zhitinghu@gmail.com
File Name: texar/modules/embedders/embedders.py
Class Name: WordEmbedder
Method Name: __init__
Project Name: OpenNMT/OpenNMT-py
Commit Name: 5972cb1690cafd70c2d1ef36c42707ec36e05276
Time: 2017-07-04
Author: sasha.rush@gmail.com
File Name: onmt/Models.py
Class Name: Decoder
Method Name: __init__
Project Name: allenai/allennlp
Commit Name: 700abc65fd2172a2c6809dd9b72cf50fc2407772
Time: 2020-02-03
Author: mattg@allenai.org
File Name: allennlp/models/srl_bert.py
Class Name: SrlBert
Method Name: __init__