MCPcopy Create free account

hub / github.com/Kyubyong/transformer / functions

Functions49 in github.com/Kyubyong/transformer

↓ 7 callersFunction_write
(sents, fname)
prepro.py:63
↓ 5 callersFunction_segment_and_write
(sents, fname)
prepro.py:88
↓ 4 callersFunctionembedding
Embeds a given tensor. Args: inputs: A `Tensor` with type `int32` or `int64` containing the ids to be looked up in `lookup table`.
tf1.2_legacy/modules.py:41
↓ 4 callersFunctionload_de_vocab
()
tf1.2_legacy/data_load.py:15
↓ 4 callersFunctionload_en_vocab
()
tf1.2_legacy/data_load.py:21
↓ 3 callersMethoddecode
memory: encoder outputs. (N, T1, d_model) src_masks: (N, T1) Returns logits: (N, T2, V). float32. y_hat: (N,
model.py:73
↓ 3 callersFunctionget_batch
Gets training / evaluation mini-batches fpath1: source file path. string. fpath2: target file path. string. maxlen1: source sent maximu
data_load.py:132
↓ 3 callersFunctionmultihead_attention
Applies multihead attention. See 3.2.2 queries: A 3d tensor with shape of [N, T_q, d_model]. keys: A 3d tensor with shape of [N, T_k, d_model]
modules.py:153
↓ 3 callersFunctionmultihead_attention
Applies multihead attention. Args: queries: A 3d tensor with shape of [N, T_q, C_q]. keys: A 3d tensor with shape of [N, T_k, C_k
tf1.2_legacy/modules.py:169
↓ 2 callersFunction_refine
(line)
tf1.2_legacy/data_load.py:59
↓ 2 callersFunctioncalc_bleu
Calculates bleu score and appends the report to translation ref: reference file path translation: model output file path Returns tran
utils.py:150
↓ 2 callersFunctioncreate_data
(source_sents, target_sents)
tf1.2_legacy/data_load.py:27
↓ 2 callersFunctionencode
Converts string to number. Used for `generator_fn`. inp: 1d byte array. type: "x" (source side) or "y" (target side) dict: token2idx di
data_load.py:50
↓ 2 callersMethodencode
Returns memory: encoder outputs. (N, T1, d_model)
model.py:38
↓ 2 callersMethodeval
Predicts autoregressively At inference, input ys is ignored. Returns y_hat: (N, T2)
model.py:162
↓ 2 callersFunctionfeedforward
Point-wise feed forward net. Args: inputs: A 3d tensor with shape of [N, T, C]. num_units: A list of two integers. scope: O
tf1.2_legacy/modules.py:259
↓ 2 callersFunctionff
position-wise feed forward net. See 3.3 inputs: A 3d tensor with shape of [N, T, C]. num_units: A list of two integers. scope: Option
modules.py:199
↓ 2 callersFunctionget_hypotheses
Gets hypotheses. num_batches: scalar. num_samples: scalar. sess: tensorflow sess object tensor: target tensor to fetch dict: idx2t
utils.py:131
↓ 2 callersFunctionln
Applies layer normalization. See https://arxiv.org/abs/1607.06450. inputs: A tensor with 2 or more dimensions, where the first dimension has `batc
modules.py:14
↓ 2 callersFunctionload_vocab
Loads vocabulary file and returns idx<->token maps vocab_fpath: string. vocabulary file path. Note that these are reserved 0: <pad>, 1:
data_load.py:15
↓ 2 callersFunctionmake_vocab
Constructs vocabulary. Args: fpath: A string. Input file path. fname: A string. Output file name. Writes vocabular
tf1.2_legacy/prepro.py:17
↓ 2 callersFunctionmask
Masks paddings on keys or queries to inputs inputs: 3d tensor. (h*N, T_q, T_k) key_masks: 3d tensor. (N, 1, T_k) type: string. "key" | "fu
modules.py:103
↓ 2 callersFunctionnormalize
Applies layer normalization. Args: inputs: A tensor with 2 or more dimensions, where the first dimension has `batch_size`.
tf1.2_legacy/modules.py:12
↓ 2 callersFunctionpositional_encoding
Sinusoidal Positional_Encoding. See 3.5 inputs: 3d tensor. (N, T, E) maxlen: scalar. Must be >= T masking: Boolean. If True, padding posit
modules.py:259
↓ 2 callersFunctionpositional_encoding
Sinusoidal Positional_Encoding. Args: inputs: A 2d Tensor with shape of (N, T). num_units: Output dimensionality zero_pad: Bool
tf1.2_legacy/modules.py:120
↓ 1 callersFunction_get_size
Gets size of tensor shape shp: TensorShape Returns size
utils.py:109
↓ 1 callersFunctioncalc_num_batches
Calculates the number of batches. total_num: total sample number batch_size Returns number of batches, allowing for remainders.
utils.py:20
↓ 1 callersFunctionconvert_idx_to_token_tensor
Converts int32 tensor to string tensor. inputs: 1d int32 tensor. indices. idx2token: dictionary Returns 1d string tensor.
utils.py:29
↓ 1 callersFunctioneval
()
tf1.2_legacy/eval.py:21
↓ 1 callersFunctionget_batch_data
()
tf1.2_legacy/data_load.py:70
↓ 1 callersFunctionget_token_embeddings
Constructs token embedding matrix. Note that the column of index 0's are set to zeros. vocab_size: scalar. V. num_units: embedding dimensi
modules.py:35
↓ 1 callersFunctioninput_fn
Batchify data sents1: list of source sents sents2: list of target sents vocab_fpath: string. vocabulary file path. batch_size: sca
data_load.py:92
↓ 1 callersFunctionlabel_smoothing
Applies label smoothing. See 5.4 and https://arxiv.org/abs/1512.00567. inputs: 3d tensor. [N, T, V], where V is the number of vocabulary. epsi
modules.py:224
↓ 1 callersFunctionlabel_smoothing
Applies label smoothing. See https://arxiv.org/abs/1512.00567. Args: inputs: A 3d tensor with shape of [N, T, V], where V is the number
tf1.2_legacy/modules.py:294
↓ 1 callersFunctionload_data
Loads source and target data and filters out too lengthy samples. fpath1: source file path. string. fpath2: target file path. string. m
data_load.py:29
↓ 1 callersFunctionload_hparams
Loads hparams and overrides parser parser: argsparse parser path: directory or file where hparams are saved
utils.py:89
↓ 1 callersFunctionload_test_data
()
tf1.2_legacy/data_load.py:58
↓ 1 callersFunctionload_train_data
()
tf1.2_legacy/data_load.py:51
↓ 1 callersFunctionnoam_scheme
Noam scheme learning rate decay init_lr: initial learning rate. scalar. global_step: scalar. warmup_steps: scalar. During warmup_steps, le
modules.py:298
↓ 1 callersFunctionpostprocess
Processes translation outputs. hypotheses: list of encoded predictions idx2token: dictionary Returns processed hypotheses
utils.py:60
↓ 1 callersFunctionprepro
Load raw data -> Preprocessing -> Segmenting with sentencepice hp: hyperparams. argparse.
prepro.py:20
↓ 1 callersFunctionsave_hparams
Saves hparams to path hparams: argsparse object. path: output directory. Writes hparams as literal dictionary to path.
utils.py:76
↓ 1 callersFunctionsave_variable_specs
Saves information about variables such as their name, shape, and total parameter number fpath: string. output file path Writes a text
utils.py:101
↓ 1 callersFunctionscaled_dot_product_attention
See 3.2.1. Q: Packed queries. 3d tensor. [N, T_q, d_k]. K: Packed keys. 3d tensor. [N, T_k, d_k]. V: Packed values. 3d tensor. [N, T_k, d_
modules.py:56
↓ 1 callersMethodtrain
Returns loss: scalar. train_op: training operation global_step: scalar. summaries: training summary node
model.py:131
Method__init__
(self, hp)
model.py:33
Method__init__
(self, is_training=True)
tf1.2_legacy/train.py:18
Functiongenerator_fn
Generates training / evaluation data sents1: list of source sents sents2: list of target sents vocab_fpath: string. vocabulary file pat
data_load.py:66
Functionmy_func
(inputs)
utils.py:37