This guide will help you set up the Shielded RecRL project on Windows without using bash scripts.
- Python 3.8+: Download from python.org
- Git: Download from git-scm.com
- CUDA Toolkit (optional, for GPU support): Download from nvidia.com
# Run PowerShell as Administrator if needed
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
.\setup_windows.ps1# Double-click setup_windows.bat or run in Command Prompt
setup_windows.batmkdir data
mkdir data\raw
mkdir data\proc
mkdir data\_checksums
mkdir checkpoints
mkdir logs
mkdir experiments
mkdir docsCreate a file named .gitignore with the following content:
*.pyc
__pycache__/
checkpoints/
logs/
*.pt
*.pth
*.bin
.env
.venv/
venv/
.idea/
.vscode/
*.log
git init -b main
git add .gitignore
git commit -m "Init repo"pip install -r requirements.txtNote: Some packages might require Microsoft Visual C++ Build Tools. If you encounter errors:
- Install Visual Studio Build Tools
- Or use pre-compiled wheels:
pip install --only-binary=all -r requirements.txt
python gpu_test.pycd code\dataset
python download_datasets.py --dataset bookspython preprocess.py --dataset bookscd ..\ranker
python train_sasrec.py --dataset books --epochs 50cd ..\explainer
python init_lora.py --dataset books --int8cd ..\projection
python basis.py --ranker_ckpt ..\checkpoints\sasrec_books.pt --output ..\checkpoints\basis_books.ptcd ..\trainer
python run_recrl.py --dataset books --cfg ..\..\experiments\recrl_default.yaml- CUDA not available: Install CUDA Toolkit and PyTorch with CUDA support
- Memory errors: Use
--int8flag for 8-bit quantization - Import errors: Ensure all dependencies are installed with
pip install -r requirements.txt - Git errors: Make sure Git is in your PATH
To enable GPU support on Windows:
- Install NVIDIA drivers
- Install CUDA Toolkit
- Install PyTorch with CUDA:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
If you prefer a Linux environment:
- Install WSL2 from Microsoft Store
- Install Ubuntu on WSL2
- Follow the original bash setup instructions
After setup, you can:
- Run experiments with different datasets (books, ml25m, steam)
- Modify training parameters in
experiments/recrl_default.yaml - Analyze results in the
logs/directory - Generate evaluation reports with
code/eval/aggregate_main.py
If you encounter issues:
- Check the troubleshooting section above
- Verify your Python and CUDA versions
- Ensure all dependencies are correctly installed
- Check the project's GitHub issues page