Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c46e485
begin debug sasrec logq, used base hookjabber commit: current logq ve…
Aksinya-Bykova Dec 18, 2025
d1fcc81
fix: apply logq correction to all logits in sampled softmax
Aksinya-Bykova Dec 18, 2025
827a830
feat: pass item IDs from SasRecInBatchModel to enable masking and LogQ
Aksinya-Bykova Dec 18, 2025
50af16c
update initialization - nothing special
Aksinya-Bykova Dec 18, 2025
e0f2000
fix: add false negative masking to SamplesSoftmaxLoss
Aksinya-Bykova Dec 18, 2025
aeed13f
fix: itit correction - nothing special
Aksinya-Bykova Dec 18, 2025
300d1e3
feat: implement full LogQ correction and FN masking for SASRec
Aksinya-Bykova Dec 18, 2025
8cd79fe
fix(loss): implement unbiased logq logic and false negative masking
Aksinya-Bykova Dec 19, 2025
f48a298
Comprehensive upgrade of SamplesSoftmaxLoss to align with Google's
Aksinya-Bykova Dec 19, 2025
85d9c63
chore(config): add SASRec in-batch training config with LogQ correction
Aksinya-Bykova Dec 19, 2025
9af07d2
add instruction - nothing special
Aksinya-Bykova Dec 19, 2025
c4eebae
feat(mclsr): implement ID pass-through for downstream LogQ and masking
Aksinya-Bykova Dec 19, 2025
e0ce73d
fix(mclsr config): add expected metrics - nothing special
Aksinya-Bykova Dec 19, 2025
e22e500
init logq mclsr and sasrec - have to work, logq 0.2 mclsr wins
Aksinya-Bykova Dec 27, 2025
68c63e4
logq softmax
Aksinya-Bykova Apr 1, 2026
f28f941
delete logq
Aksinya-Bykova Apr 1, 2026
eaf2b88
clean
Aksinya-Bykova Apr 1, 2026
1749edf
clean old code
Aksinya-Bykova Apr 1, 2026
a702721
code format
Aksinya-Bykova Apr 1, 2026
43c5d3c
perf: optimize _filter_matrix_by_top_k using CSR in-place operations
Aksinya-Bykova Apr 4, 2026
aff9bd5
perf: dataloader pin memory optimization
Aksinya-Bykova Apr 4, 2026
1d99479
perf: mclsr cpu gpu (also forgot transfer exp-4 branch)
Aksinya-Bykova Apr 4, 2026
1ebbf34
perf dataloader
Aksinya-Bykova Apr 4, 2026
ece48b8
perf dataset
Aksinya-Bykova Apr 4, 2026
4e008f2
perf optimized version config
Aksinya-Bykova Apr 4, 2026
5d3cb88
perf batch batch processors
Aksinya-Bykova Apr 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 3 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

# Steps on local machine
<p align="center">
<a>
<img src="./assets/irec_logo.png" alt="cool irec logo" width="40%" height="40%">
Expand Down Expand Up @@ -40,26 +42,6 @@
uv sync --frozen
```

### Using pip

1. Create and activate a virtual environment:
```bash
python3 -m venv .venv
source ./.venv/bin/activate
```

2. Install dependencies:

**For development:**
```bash
pip install -e ".[dev]"
```

**For production:**
```bash
pip install -e .
```

## Preparing datasets
All pre-processed datasets used in our experiments are available for download from our cloud storage. This is the fastest way to get started.

Expand Down Expand Up @@ -91,4 +73,4 @@ The script has 1 input argument: `params` which is the path to the json file wit

-`callbacks` Different additional traning

-`use_wandb` Enable Weights & Biases logging for experiment tracking
-`use_wandb` Enable Weights & Biases logging for experiment tracking
88 changes: 0 additions & 88 deletions configs/inference/sasrec_inference_config.json

This file was deleted.

233 changes: 233 additions & 0 deletions configs/train/mclsr_baseline_clothing_sanity.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
{
"experiment_name": "mclsr_Clothing",
"use_wandb": true,
"best_metric": "validation/ndcg@20",
"dataset": {
"type": "graph",
"use_user_graph": true,
"use_item_graph": true,
"neighborhood_size": 50,
"graph_dir_path": "./data/Clothing",
"dataset": {
"type": "mclsr",
"path_to_data_dir": "./data",
"name": "Clothing",
"max_sequence_length": 20,
"samplers": {
"num_negatives_val": 1280,
"num_negatives_train": 1280,
"type": "mclsr",
"negative_sampler_type": "random"
}
}
},
"dataloader": {
"train": {
"type": "torch",
"batch_size": 128,
"batch_processor": {
"type": "basic"
},
"drop_last": true,
"shuffle": true,
"num_workers": 4,
"pin_memory" : true
},
"validation": {
"type": "torch",
"batch_size": 128,
"batch_processor": {
"type": "basic"
},
"drop_last": false,
"shuffle": false,
"num_workers": 4,
"pin_memory" : true
}
},
"model": {
"type": "mclsr",
"sequence_prefix": "item",
"user_prefix": "user",
"labels_prefix": "labels",
"candidate_prefix": "candidates",
"embedding_dim": 64,
"num_graph_layers": 2,
"dropout": 0.3,
"layer_norm_eps": 1e-9,
"graph_dropout": 0.3,
"initializer_range": 0.02,
"alpha": 0.5
},
"optimizer": {
"type": "basic",
"optimizer": {
"type": "adam",
"lr": 0.001
}
},
"loss": {
"type": "composite",
"losses": [
{
"type": "sampled_softmax",
"queries_prefix": "combined_representation",
"positive_prefix": "label_representation",
"negative_prefix": "negative_representation",
"output_prefix": "downstream_loss",
"weight": 1.0
},
{
"type": "fps",
"fst_embeddings_prefix": "sequential_representation",
"snd_embeddings_prefix": "graph_representation",
"output_prefix": "contrastive_interest_loss",
"weight": 1.0,
"temperature": 0.5
},
{
"type": "fps",
"fst_embeddings_prefix": "user_graph_user_embeddings",
"snd_embeddings_prefix": "common_graph_user_embeddings",
"output_prefix": "contrastive_user_feature_loss",
"weight": 0.05,
"temperature": 0.5
},
{
"type": "fps",
"fst_embeddings_prefix": "item_graph_item_embeddings",
"snd_embeddings_prefix": "common_graph_item_embeddings",
"output_prefix": "contrastive_item_feature_loss",
"weight": 0.05,
"temperature": 0.5
}
],
"output_prefix": "loss"
},
"callback": {
"type": "composite",
"callbacks": [
{
"type": "metric",
"on_step": 1,
"loss_prefix": "loss"
},
{
"type": "metric",
"on_step": 1,
"loss_prefix": "downstream_loss"
},
{
"type": "metric",
"on_step": 1,
"loss_prefix": "contrastive_interest_loss"
},
{
"type": "metric",
"on_step": 1,
"loss_prefix": "contrastive_user_feature_loss"
},
{
"type": "metric",
"on_step": 1,
"loss_prefix": "contrastive_item_feature_loss"
},
{
"type": "validation",
"on_step": 64,
"pred_prefix": "predictions",
"labels_prefix": "labels",
"metrics": {
"ndcg@5": {
"type": "mclsr-ndcg",
"k": 5
},
"ndcg@10": {
"type": "mclsr-ndcg",
"k": 10
},
"ndcg@20": {
"type": "mclsr-ndcg",
"k": 20
},
"ndcg@50": {
"type": "mclsr-ndcg",
"k": 50
},
"recall@5": {
"type": "mclsr-recall",
"k": 5
},
"recall@10": {
"type": "mclsr-recall",
"k": 10
},
"recall@20": {
"type": "mclsr-recall",
"k": 20
},
"recall@50": {
"type": "mclsr-recall",
"k": 50
},
"hit@20": {
"type": "mclsr-hit",
"k": 20
},
"hit@50": {
"type": "mclsr-hit",
"k": 50
}
}
},
{
"type": "eval",
"on_step": 256,
"pred_prefix": "predictions",
"labels_prefix": "labels",
"metrics": {
"ndcg@5": {
"type": "mclsr-ndcg",
"k": 5
},
"ndcg@10": {
"type": "mclsr-ndcg",
"k": 10
},
"ndcg@20": {
"type": "mclsr-ndcg",
"k": 20
},
"ndcg@50": {
"type": "mclsr-ndcg",
"k": 50
},
"recall@5": {
"type": "mclsr-recall",
"k": 5
},
"recall@10": {
"type": "mclsr-recall",
"k": 10
},
"recall@20": {
"type": "mclsr-recall",
"k": 20
},
"recall@50": {
"type": "mclsr-recall",
"k": 50
},
"hit@20": {
"type": "mclsr-hit",
"k": 20
},
"hit@50": {
"type": "mclsr-hit",
"k": 50
}
}
}
]
}
}
Loading