Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
6ceebaa7
Unverified
Commit
6ceebaa7
authored
Aug 29, 2023
by
Rhett Ying
Committed by
GitHub
Aug 29, 2023
Browse files
[GraphBolt] use str etype in data block (#6231)
parent
ba61a566
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
19 deletions
+8
-19
python/dgl/graphbolt/data_block.py
python/dgl/graphbolt/data_block.py
+1
-4
python/dgl/graphbolt/link_prediction_block.py
python/dgl/graphbolt/link_prediction_block.py
+7
-15
No files found.
python/dgl/graphbolt/data_block.py
View file @
6ceebaa7
...
...
@@ -35,12 +35,9 @@ class DataBlock:
The keys are tuples in the format '(edge_type, feature_name)', and the
values represent the corresponding features. In the case of a homogeneous
graph where no edge types exist, 'edge_type' should be set to None.
Note 'edge_type' are of format 'str:str:str'.
"""
input_nodes
:
Union
[
torch
.
Tensor
,
Dict
[
Tuple
[
str
,
str
,
str
],
torch
.
Tensor
]
]
=
None
input_nodes
:
Union
[
torch
.
Tensor
,
Dict
[
str
,
torch
.
Tensor
]]
=
None
"""A representation of input nodes in the outermost layer. Conatins all nodes
in the 'sampled_subgraphs'.
- If `input_nodes` is a tensor: It indicates the graph is homogeneous.
...
...
python/dgl/graphbolt/link_prediction_block.py
View file @
6ceebaa7
...
...
@@ -16,7 +16,7 @@ class LinkPredictionBlock(DataBlock):
node_pair
:
Union
[
Tuple
[
torch
.
Tensor
,
torch
.
Tensor
],
Dict
[
Tuple
[
str
,
str
,
str
]
,
Tuple
[
torch
.
Tensor
,
torch
.
Tensor
]],
Dict
[
str
,
Tuple
[
torch
.
Tensor
,
torch
.
Tensor
]],
]
=
None
"""
Representation of seed node pairs utilized in link prediction tasks.
...
...
@@ -27,7 +27,7 @@ class LinkPredictionBlock(DataBlock):
type.
"""
label
:
Union
[
torch
.
Tensor
,
Dict
[
Tuple
[
str
,
str
,
str
]
,
torch
.
Tensor
]]
=
None
label
:
Union
[
torch
.
Tensor
,
Dict
[
str
,
torch
.
Tensor
]]
=
None
"""
Labels associated with the link prediction task.
- If `label` is a tensor: It indicates a homogeneous graph. The value are
...
...
@@ -36,9 +36,7 @@ class LinkPredictionBlock(DataBlock):
should correspond to given 'node_pair'.
"""
negative_head
:
Union
[
torch
.
Tensor
,
Dict
[
Tuple
[
str
,
str
,
str
],
torch
.
Tensor
]
]
=
None
negative_head
:
Union
[
torch
.
Tensor
,
Dict
[
str
,
torch
.
Tensor
]]
=
None
"""
Representation of negative samples for the head nodes in the link
prediction task.
...
...
@@ -48,9 +46,7 @@ class LinkPredictionBlock(DataBlock):
given type.
"""
negative_tail
:
Union
[
torch
.
Tensor
,
Dict
[
Tuple
[
str
,
str
,
str
],
torch
.
Tensor
]
]
=
None
negative_tail
:
Union
[
torch
.
Tensor
,
Dict
[
str
,
torch
.
Tensor
]]
=
None
"""
Representation of negative samples for the tail nodes in the link
prediction task.
...
...
@@ -62,24 +58,20 @@ class LinkPredictionBlock(DataBlock):
compacted_node_pair
:
Union
[
Tuple
[
torch
.
Tensor
,
torch
.
Tensor
],
Dict
[
Tuple
[
str
,
str
,
str
]
,
Tuple
[
torch
.
Tensor
,
torch
.
Tensor
]],
Dict
[
str
,
Tuple
[
torch
.
Tensor
,
torch
.
Tensor
]],
]
=
None
"""
Representation of compacted node pairs corresponding to 'node_pair', where
all node ids inside are compacted.
"""
compacted_negative_head
:
Union
[
torch
.
Tensor
,
Dict
[
Tuple
[
str
,
str
,
str
],
torch
.
Tensor
]
]
=
None
compacted_negative_head
:
Union
[
torch
.
Tensor
,
Dict
[
str
,
torch
.
Tensor
]]
=
None
"""
Representation of compacted nodes corresponding to 'negative_head', where
all node ids inside are compacted.
"""
compacted_negative_tail
:
Union
[
torch
.
Tensor
,
Dict
[
Tuple
[
str
,
str
,
str
],
torch
.
Tensor
]
]
=
None
compacted_negative_tail
:
Union
[
torch
.
Tensor
,
Dict
[
str
,
torch
.
Tensor
]]
=
None
"""
Representation of compacted nodes corresponding to 'negative_tail', where
all node ids inside are compacted.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment