Skip to content

Commit

Permalink
Merge branch 'RUCAIBox:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethan-TZ authored Oct 25, 2021
2 parents 38ad48c + 186a9f9 commit f3c8354
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/source/user_guide/config/evaluation_settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Evaluation settings are designed to set parameters about model evaluation.

- ``split (dict)``: decides how we split the data in `.inter`. Now we support two kinds of splitting strategies: ``['RS','LS']``, which denotes the ratio-based data splitting and leave-one-out data splitting. If the key of ``split`` is ``RS``, you need to set the splitting ratio like ``[0.8,0.1,0.1]``, ``[7,2,1]`` or ``[8,0,2]``, which denotes the ratio of training set, validation set and testing set respectively. If the key of ``split`` is ``LS``, now we support three kinds of ``LS`` mode: ``['valid_and_test', 'valid_only', 'test_only']`` and you should choose one mode as the value of ``LS``. The default value of ``split`` is ``{'RS': [0.8,0.1,0.1]}``.

- ``mode (str)``: decides the data range which we evaluate the model on. Now we support four kinds of evaluation mode: ``['full','unixxx','popxxx','labeled']``. ``full`` , ``unixxx`` and ``popxxx`` are designed for the evaluation on implicit feedback (data without label). For implicit feedback, we regard the items with observed interactions as positive items and those without observed interactions as negative items. ``full`` means evaluating the model on the set of all items. ``unixxx``, for example ``uni100``, means uniformly sample 100 negative items for each positive item in testing set, and evaluate the model on these positive items with their sampled negative items. ``popxxx``, for example ``pop100``, means sample 100 negative items for each positive item in testing set based on item popularity (:obj:`Counter(item)` in `.inter` file), and evaluate the model on these positive items with their sampled negative items. Here the `xxx` must be an integer. For explicit feedback (data with label), you should set the mode as ``None`` and we will evaluate the model based on your label. The default value is ``full``.
- ``mode (str)``: decides the data range which we evaluate the model on. Now we support four kinds of evaluation mode: ``['full','unixxx','popxxx','labeled']``. ``full`` , ``unixxx`` and ``popxxx`` are designed for the evaluation on implicit feedback (data without label). For implicit feedback, we regard the items with observed interactions as positive items and those without observed interactions as negative items. ``full`` means evaluating the model on the set of all items. ``unixxx``, for example ``uni100``, means uniformly sample 100 negative items for each positive item in testing set, and evaluate the model on these positive items with their sampled negative items. ``popxxx``, for example ``pop100``, means sample 100 negative items for each positive item in testing set based on item popularity (:obj:`Counter(item)` in `.inter` file), and evaluate the model on these positive items with their sampled negative items. Here the `xxx` must be an integer. For explicit feedback (data with label), you should set the mode as ``labeled`` and we will evaluate the model based on your label. The default value is ``full``.

- ``repeatable (bool)``: Whether to evaluate the result with a repeatable recommendation scene. Note that it is disabled for sequential models as the recommendation is already repeatable. For other models, defaults to ``False``.
- ``metrics (list or str)``: Evaluation metrics. Defaults to
Expand Down
5 changes: 3 additions & 2 deletions recbole/model/general_recommender/enmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ def calculate_loss(self, interaction):
self.item_embedding.weight.unsqueeze(1)).sum(dim=0)

# shape: [embedding_size, embedding_size]
user_sum = torch.bmm(self.user_embedding.weight.unsqueeze(2),
self.user_embedding.weight.unsqueeze(1)).sum(dim=0)
batch_user = self.user_embedding(user)
user_sum = torch.bmm(batch_user.unsqueeze(2),
batch_user.unsqueeze(1)).sum(dim=0)

# shape: [embedding_size, embedding_size]
H_sum = torch.matmul(self.H_i.weight.t(), self.H_i.weight)
Expand Down
2 changes: 1 addition & 1 deletion recbole/properties/dataset/url.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ lfm1b-tracks-not-merged: https://recbole.s3-accelerate.amazonaws.com/ProcessedDa
mind-large-dev: https://recbole.s3-accelerate.amazonaws.com/ProcessedDatasets/MIND/mind_large_dev.zip
mind-large-train: https://recbole.s3-accelerate.amazonaws.com/ProcessedDatasets/MIND/mind_large_train.zip
mind-small-dev: https://recbole.s3-accelerate.amazonaws.com/ProcessedDatasets/MIND/mind_small_dev.zip
mind-small_train: https://recbole.s3-accelerate.amazonaws.com/ProcessedDatasets/MIND/mind_small_train.zip
mind-small-train: https://recbole.s3-accelerate.amazonaws.com/ProcessedDatasets/MIND/mind_small_train.zip
ml-100k: https://recbole.s3-accelerate.amazonaws.com/ProcessedDatasets/MovieLens/ml-100k.zip
ml-1m: https://recbole.s3-accelerate.amazonaws.com/ProcessedDatasets/MovieLens/ml-1m.zip
ml-10m: https://recbole.s3-accelerate.amazonaws.com/ProcessedDatasets/MovieLens/ml-10m.zip
Expand Down

0 comments on commit f3c8354

Please sign in to comment.