### Install Dependencies Source: https://github.com/gusye1234/lightgcn-pytorch/blob/master/README.md Install the required Python packages using pip. ```shell pip install -r requirements.txt ``` -------------------------------- ### LightGCN Training Log Output Example Source: https://github.com/gusye1234/lightgcn-pytorch/blob/master/README.md Example log output during LightGCN training, showing epoch progress, BPR sample time, average loss, and test results. This output can be used to verify training consistency. ```shell ... ====================== EPOCH[5/1000] BPR[sample time][16.2=15.84+0.42] [saved][[BPR[aver loss1.128e-01]] [0;30;43m[TEST][0m {'precision': array([0.03315359]), 'recall': array([0.10711388]), 'ndcg': array([0.08940792])} [TOTAL TIME] 35.9975962638855 ... ====================== EPOCH[116/1000] BPR[sample time][16.9=16.60+0.45] [saved][[BPR[aver loss2.056e-02]] [TOTAL TIME] 30.99874997138977 ... ``` -------------------------------- ### Run LightGCN on Gowalla Dataset Source: https://github.com/gusye1234/lightgcn-pytorch/blob/master/README.md Command to execute the LightGCN model on the Gowalla dataset with specified hyperparameters. Ensure you are in the 'code' directory. ```shell cd code && python main.py --decay=1e-4 --lr=0.001 --layer=3 --seed=2020 --dataset="gowalla" --topks="[20]" --recdim=64 ``` -------------------------------- ### Implement Custom DataLoader Source: https://github.com/gusye1234/lightgcn-pytorch/blob/master/README.md To use your own dataset, implement a dataloader inheriting from BasicDataset in dataloader.py and register it in register.py. ```python # In dataloader.py # class YourDataset(BasicDataset): # ... # In register.py # register_dataset(YourDataset) ``` -------------------------------- ### Implement Custom Model Source: https://github.com/gusye1234/lightgcn-pytorch/blob/master/README.md To use your own models, implement a model inheriting from BasicModel in model.py and register it in register.py. ```python # In model.py # class YourModel(BasicModel): # ... # In register.py # register_model(YourModel) ``` -------------------------------- ### Implement Custom Sampling Method Source: https://github.com/gusye1234/lightgcn-pytorch/blob/master/README.md To use your own sampling methods, implement a function in Procedure.py and modify the corresponding code in main.py. ```python # In Procedure.py # def your_sampling_method(...): # ... # In main.py # Modify the sampling part to use your_sampling_method ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.