From 3495dd6209b2a5eed9e1bf3703f2a849cf4e8a34 Mon Sep 17 00:00:00 2001 From: timoniche Date: Sat, 25 Oct 2025 23:33:04 +0300 Subject: [PATCH] bug corrections: max epoch_cnt logic, item_ids_mapping -> item_ids_mapping_df, inter_new.json -> inter.json (?), minor N -> H in doc --- README.md | 2 +- notebooks/DatasetProcessing.ipynb | 4 ++-- tiger/modeling/trainer/trainer.py | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a1d6700..8406096 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ Because there is no official TIGER reference implementation, we compare on Beaut Following the original setup, we report NDCG (N) and Hit Rate (H) with @5, @10, and additionaly @20 cutoffs. -| Model | Dataset | N@5 | N@10 | N@20 | H@5 | H@10 | N@20 | +| Model | Dataset | N@5 | N@10 | N@20 | H@5 | H@10 | H@20 | |--------|---------|-------------|-------------|-------------|-------------|-------------|-------------| | SASRec | Beauty | 0.02087 | 0.02718 | 0.03447 | 0.03197 | 0.051647 | 0.08071 | | TIGER | Beauty | **0.02524** | **0.03191** | **0.03940** | **0.03756** | **0.05822** | **0.08800** | diff --git a/notebooks/DatasetProcessing.ipynb b/notebooks/DatasetProcessing.ipynb index 00bc16d..1817789 100644 --- a/notebooks/DatasetProcessing.ipynb +++ b/notebooks/DatasetProcessing.ipynb @@ -33,7 +33,7 @@ "interactions_dataset_path = '../data/Beauty/Beauty_5.json'\n", "metadata_path = '../data/Beauty/metadata.json'\n", "\n", - "interactions_output_path = '../data/Beauty/inter_new.json'\n", + "interactions_output_path = '../data/Beauty/inter.json'\n", "embeddings_output_path = '../data/Beauty/content_embeddings.pkl'" ] }, @@ -287,7 +287,7 @@ "metadata": {}, "outputs": [], "source": [ - "data = get_data(pl.from_pandas(df), item_ids_mapping)" + "data = get_data(pl.from_pandas(df), item_ids_mapping_df)" ] }, { diff --git a/tiger/modeling/trainer/trainer.py b/tiger/modeling/trainer/trainer.py index 2a9c77c..9a37d90 100644 --- a/tiger/modeling/trainer/trainer.py +++ b/tiger/modeling/trainer/trainer.py @@ -79,6 +79,10 @@ def train(self): LOGGER.debug('Start training...') while (step_num < 200_000): + if self._epoch_cnt is not None and epoch_num >= self._epoch_cnt: + LOGGER.debug( + 'Reached the maximum number of epochs ({}). Finish training'.format(self._epoch_cnt)) + break if best_epoch + self._epochs_threshold < epoch_num: LOGGER.debug( 'There is no progress during {} epochs. Finish training'.format(self._epochs_threshold))