Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Wang-Shuo/Neural-Attentive-Session-Based-Recommendation-PyTorch
/ functions
Functions
18 in github.com/Wang-Shuo/Neural-Attentive-Session-Based-Recommendation-PyTorch
⨍
Functions
18
◇
Types & classes
2
↓ 2 callers
Function
len_argsort
(seq)
dataset.py:83
↓ 2 callers
Function
process_seqs
(iseqs, idates)
datasets/preprocess.py:194
↓ 2 callers
Function
validate
(valid_loader, model)
main.py:128
↓ 1 callers
Function
get_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 callers
Function
get_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 callers
Method
init_hidden
(self, batch_size)
narm.py:67
↓ 1 callers
Function
load_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 callers
Function
main
()
main.py:50
↓ 1 callers
Function
obtian_tes
()
datasets/preprocess.py:172
↓ 1 callers
Function
obtian_tra
()
datasets/preprocess.py:147
↓ 1 callers
Function
trainForEpoch
(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
Function
collate_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
Function
evaluate
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
Method
forward
(self, seq, lengths)
narm.py:36