# Rethinking Graph Out-Of-Distribution Generalization: A Learnable Random Walk Perspective

## Overview
This is the official source code of LRW-OOD.

## Requirements
The PyTorch version we use is torch 1.13.1+cu117. Please refer to the official website -- https://pytorch.org/get-started/locally/ for the detailed installation instructions.

## Environments
The experiments are conducted on the machine with Intel(R) Xeon(R) Gold 6240 CPU 2.60GHz, and NVIDIA A800 with 80GB memory and CUDA 12.4. The operating system is Ubuntu 20.04.4 LTS with 1.0TB memory.

## Training
Run the following command to train the LRW encoder:
```Training
python3 main_lrw.py --data_name cora --model_name lrw
```
Run the following command to train the OOD classifier:
```Training
python3 main_classifier.py --data_name cora --model_name classifier
```