MCPcopy Create free account

hub / github.com/Wang-Shuo/Neural-Attentive-Session-Based-Recommendation-PyTorch / functions

Functions18 in github.com/Wang-Shuo/Neural-Attentive-Session-Based-Recommendation-PyTorch

↓ 2 callersFunctionlen_argsort
(seq)
dataset.py:83
↓ 2 callersFunctionprocess_seqs
(iseqs, idates)
datasets/preprocess.py:194
↓ 2 callersFunctionvalidate
(valid_loader, model)
main.py:128
↓ 1 callersFunctionget_mrr
Calculates the MRR score for the given predictions and targets Args: indices (Bxk): torch.LongTensor. top-k indices predicted by the
metric.py:25
↓ 1 callersFunctionget_recall
Calculates the recall score for the given predictions and targets Args: indices (Bxk): torch.LongTensor. top-k indices predicted by
metric.py:4
↓ 1 callersMethodinit_hidden
(self, batch_size)
narm.py:67
↓ 1 callersFunctionload_data
Loads the dataset :type path: String :param path: The path to the dataset (here RSC2015) :type n_items: int :param n_items: The numbe
dataset.py:16
↓ 1 callersFunctionmain
()
main.py:50
↓ 1 callersFunctionobtian_tes
()
datasets/preprocess.py:172
↓ 1 callersFunctionobtian_tra
()
datasets/preprocess.py:147
↓ 1 callersFunctiontrainForEpoch
(train_loader, model, optimizer, epoch, num_epochs, criterion, log_aggr=1)
main.py:99
Method__getitem__
(self, index)
dataset.py:112
Method__init__
(self, n_items, hidden_size, embedding_dim, batch_size, n_layers = 1)
narm.py:18
Method__init__
(self, data)
dataset.py:105
Method__len__
(self)
dataset.py:117
Functioncollate_fn
This function will be used to pad the sessions to max length in the batch and transpose the batch from batch_size x max_seq_len to max_
utils.py:7
Functionevaluate
Evaluates the model using Recall@K, MRR@K scores. Args: logits (B,C): torch.LongTensor. The predicted logit for the next items.
metric.py:46
Methodforward
(self, seq, lengths)
narm.py:36