cora
Bases: graph_dataloader
A dataloader class for the Cora dataset.
This class extends graph_dataloader
to handle the Cora graph dataset,
which is commonly used in graph-based machine learning research.
Attributes:
Name | Type | Description |
---|---|---|
data_profile |
dict
|
Metadata and download links specific to the Cora dataset. |
graph |
graph
|
The loaded graph structure for the Cora dataset. |
Methods:
Name | Description |
---|---|
__init__ |
Initializes the dataloader for the Cora dataset. |
get_train_test_idx |
Generates train and test indices for the Cora dataset. |
Source code in tinybig/data/graph_dataloader.py
__init__(name='cora', train_batch_size=64, test_batch_size=64, *args, **kwargs)
Initializes the dataloader for the Cora dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the dataset. |
'cora'
|
train_batch_size
|
int
|
Batch size for the training dataset. |
64
|
test_batch_size
|
int
|
Batch size for the testing dataset. |
64
|
Returns:
Type | Description |
---|---|
None
|
|
Source code in tinybig/data/graph_dataloader.py
get_train_test_idx(X=None, y=None, *args, **kwargs)
Generates train and test indices for the Cora dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
Tensor
|
Node features (not used in this method). |
None
|
y
|
Tensor
|
Labels (not used in this method). |
None
|
Returns:
Type | Description |
---|---|
tuple
|
Train indices ( |
Notes
The train indices are predefined as the first 140 nodes. The test indices are predefined as nodes 500 to 1499.