Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/agadetsky/pytorch-definitions
/ functions
Functions
58 in github.com/agadetsky/pytorch-definitions
⨍
Functions
58
◇
Types & classes
11
↓ 28 callers
Method
load
(self, path)
source/datasets.py:61
↓ 10 callers
Method
encode_seq
(self, arr)
source/datasets.py:40
↓ 7 callers
Method
add_token
(self, tok)
source/datasets.py:52
↓ 7 callers
Function
pad
(seq, size, value)
source/datasets.py:70
↓ 7 callers
Method
save
(self, path)
source/datasets.py:57
↓ 4 callers
Method
__init__
(self)
source/layers.py:12
↓ 3 callers
Method
encode
(self, tok)
source/datasets.py:28
↓ 3 callers
Function
generate
model - DefinitionModelingModel voc - model Vocabulary tau - temperature to generate with n - number of samples length - length o
source/pipeline.py:123
↓ 3 callers
Method
init_embeddings_from_pretrained
(self, weights, freeze)
source/model.py:168
↓ 3 callers
Method
step
(self)
source/utils.py:78
↓ 2 callers
Method
decode
(self, idx)
source/datasets.py:34
↓ 2 callers
Function
get_bleu_score
(bleu_path, all_ref_paths, d, hyp_path)
bleu.py:75
↓ 2 callers
Method
init_embeddings
(self, freeze)
source/model.py:162
↓ 2 callers
Method
init_linear
(self)
source/model.py:196
↓ 2 callers
Method
init_rnn
(self)
source/model.py:171
↓ 2 callers
Function
next_n_lines
(file_opened, N)
bleu.py:37
↓ 2 callers
Function
test
Function for testing the model on dataloader dataloader - either LanguageModeling or DefinitionModeling dataloader model - Defini
source/pipeline.py:66
↓ 2 callers
Method
zero_grad
(self)
source/utils.py:74
↓ 1 callers
Method
decode_seq
(self, arr)
source/datasets.py:46
↓ 1 callers
Function
generate_batch
(batch_size=128)
train_attention_skipgram.py:162
↓ 1 callers
Function
generate_neg
(batch_size, negative=10)
train_attention_skipgram.py:158
↓ 1 callers
Method
get_mask
(self, context)
source/layers.py:62
↓ 1 callers
Method
init_attn
(self, freeze)
source/layers.py:72
↓ 1 callers
Method
init_attn_from_pretrained
(self, weights, freeze)
source/layers.py:82
↓ 1 callers
Method
init_ch
(self)
source/layers.py:141
↓ 1 callers
Method
init_gated
(self)
source/layers.py:227
↓ 1 callers
Method
init_hidden
(self)
source/layers.py:180
↓ 1 callers
Method
init_linear_from_pretrained
(self, weights)
source/model.py:201
↓ 1 callers
Method
init_rnn_from_pretrained
(self, weights)
source/model.py:179
↓ 1 callers
Method
init_weights
(self)
source/model.py:208
↓ 1 callers
Function
prepare_ada_vectors_from_python
file - path to file with words and contexts on each line separated by \t, words and punctuation marks in contexts are separated by spaces
source/utils.py:9
↓ 1 callers
Function
prepare_w2v_vectors
file - path to file with words and contexts on each line separated by \t, words and punctuation marks in contexts are separated by spaces
source/utils.py:41
↓ 1 callers
Function
read_def_file
(file, n, with_contexts=False)
bleu.py:41
↓ 1 callers
Function
read_ref_file
(file, with_contexts=False)
bleu.py:58
↓ 1 callers
Function
train_epoch
Function for training the model one epoch dataloader - either LanguageModeling or DefinitionModeling dataloader model - Definitio
source/pipeline.py:10
Function
DefinitionModelingCollate
(batch)
source/datasets.py:214
Function
LanguageModelingCollate
(batch)
source/datasets.py:104
Method
__getitem__
(self, idx)
source/datasets.py:95
Method
__getitem__
(self, idx)
source/datasets.py:190
Method
__init__
(self, n_attn_tokens, n_attn_embsize, n_attn_hid, attn_dropout, sparse=False)
source/layers.py:27
Method
__init__
(self, n_ch_tokens, ch_maxlen, ch_emb_size, ch_feature_maps, ch_kernel_sizes)
source/layers.py:92
Method
__init__
(self, cond_size, hidden_size, out_size)
source/layers.py:157
Method
__init__
(self, cond_size, hidden_size)
source/layers.py:191
Method
__init__
(self, *op)
source/utils.py:71
Method
__init__
(self)
source/datasets.py:11
Method
__init__
Args: file (string): Path to the file vocab_path (string): path to word vocab to use bptt (int): length o
source/datasets.py:79
Method
__init__
Args: file (string): path to the file vocab_path (string): path to word vocab to use input_vectors_path (
source/datasets.py:127
Method
__init__
(self, n_attn_tokens, n_attn_embsize, n_attn_hid, attn_dropout, sparse=False)
source/attention_skipgram.py:9
Method
__init__
(self, params)
source/model.py:12
Method
__len__
(self)
source/datasets.py:92
Method
__len__
(self)
source/datasets.py:187
Method
forward
Vectors are already prepaired in DataLoaders, so just return them
source/layers.py:15
Method
forward
(self, word, context)
source/layers.py:57
Method
forward
(self, x)
source/layers.py:127
Method
forward
(self, hidden, conds)
source/layers.py:168
Method
forward
(self, hidden, conds)
source/layers.py:209
Method
forward
(self, words, context, neg)
source/attention_skipgram.py:32
Method
forward
x - definitions/LM_sequence to read input - vectors for Input, Input-Adaptive or dummy conditioning word - words for Input-At
source/model.py:111