PacktPublishing / Hands-On-Graph-Neural-Networks-Using-Python

Hands-On Graph Neural Networks Using Python, published by Packt
MIT License
752 stars 198 forks source link

Fixed PPI example that used incorrectly 'DataLoader' instead of 'NeighborLoader' #3

Closed balvisio closed 1 year ago

balvisio commented 1 year ago

In the Chapter 8 notebook, the PPI example defines the loader (a NeighborLoader) which is never used to train the GraphSAGE model:

train_data = Batch.from_data_list(train_dataset)
loader = NeighborLoader(train_data, batch_size=2048, shuffle=True, num_neighbors=[20, 10], num_workers=2, persistent_workers=True) # It is never used

# Evaluation loaders (one datapoint corresponds to a graph)
train_loader = DataLoader(train_dataset, batch_size=2) # This is used AFAIU incorrectly

This change fixes this issue. Also, this change makes the fit() signatures consistent across the notebook to take the loader as a param instead of using variables declared outside the function.

@utkarsha-Packt @mlabonne : I would appreciate if you take a look. Thanks!

mlabonne commented 1 year ago

Hi @balvisio and thank you for noticing this mistake. I tested your fix and it's great, I'm merging it.