MLDatasets.jl
MLDatasets.jl copied to clipboard
load torch tensors in OGBDatasets
Some of the features of the OGBDataset are downloaded as torch tensor stored in the ".pt" format. They are currently ignored at the moment, but we could load them using Pickle.jl (e.g. see this comment)
Can I work on this?
Sure. I don't remember for which specific dataset this was needed though
This problem can be seen in OGBDataset("ogbl-collab")
Been inactive due to Uni. exams, will start working on it today.
Some problems have been overcome here, including loading ".pt" format using Pickle.jl and have been discussed with @chengchingwen : https://github.com/yuehhua/GraphMLDatasets.jl/blob/65d6a2bb02d31569a64b47004a0c4b192739a066/src/preprocess.jl#L391 Hope these code help.
Split tensors appear for edge-level tasks in OGB Datasets. The dataset loading for LinkPropped Datasets differs from GraphPropped or NodePropped. We might need a change of OGB-Dataset APIs. Here are some approaches:
- Mention the split of the dataset
data = OGBDataset(name, split; dir)
But this has one obvious problem: loading any split eg. train would involve computation of the other two splits (val and test) given the intertwined nature of how the data is stored.
- Return train, test and validation split for each dataset
train_data, test_data, valid_data = OGBDataset(name; dir)
Can be ambiguous for non-split datasets and does not exactly match with other dataset APIs.
- Compute split from dataset
data = OGBDataset(name; dir)
train_split = split(data, :train) # this may weird way to do
# maybe something like
train_split = data[:train]
Representation for link tasks in OGBDataset will differ from Node or Graph tasks.
Also, API for splits should be consistent for different data sources. eg: Cora and OGBDataset access training masks using different APIs.