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
cbfc8085
Unverified
Commit
cbfc8085
authored
Aug 25, 2023
by
Hongzhi (Steve), Chen
Committed by
GitHub
Aug 25, 2023
Browse files
[Misc] Always use subgraph instead of sub_graph. (#6213)
parent
b8e93575
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
python/dgl/graphbolt/impl/neighbor_sampler.py
python/dgl/graphbolt/impl/neighbor_sampler.py
+1
-1
python/dgl/graphbolt/subgraph_sampler.py
python/dgl/graphbolt/subgraph_sampler.py
+2
-4
No files found.
python/dgl/graphbolt/impl/neighbor_sampler.py
View file @
cbfc8085
...
@@ -88,7 +88,7 @@ class NeighborSampler(SubgraphSampler):
...
@@ -88,7 +88,7 @@ class NeighborSampler(SubgraphSampler):
self
.
prob_name
=
prob_name
self
.
prob_name
=
prob_name
self
.
graph
=
graph
self
.
graph
=
graph
def
_sample_sub
_
graphs
(
self
,
seeds
):
def
_sample_subgraphs
(
self
,
seeds
):
subgraphs
=
[]
subgraphs
=
[]
num_layers
=
len
(
self
.
fanouts
)
num_layers
=
len
(
self
.
fanouts
)
for
hop
in
range
(
num_layers
):
for
hop
in
range
(
num_layers
):
...
...
python/dgl/graphbolt/subgraph_sampler.py
View file @
cbfc8085
...
@@ -40,9 +40,7 @@ class SubgraphSampler(Mapper):
...
@@ -40,9 +40,7 @@ class SubgraphSampler(Mapper):
seeds
=
data
.
seed_node
seeds
=
data
.
seed_node
else
:
else
:
raise
TypeError
(
f
"Unsupported type of data
{
data
}
."
)
raise
TypeError
(
f
"Unsupported type of data
{
data
}
."
)
data
.
input_nodes
,
data
.
sampled_subgraphs
=
self
.
_sample_sub_graphs
(
data
.
input_nodes
,
data
.
sampled_subgraphs
=
self
.
_sample_subgraphs
(
seeds
)
seeds
)
return
data
return
data
def
_link_prediction_preprocess
(
self
,
data
):
def
_link_prediction_preprocess
(
self
,
data
):
...
@@ -105,5 +103,5 @@ class SubgraphSampler(Mapper):
...
@@ -105,5 +103,5 @@ class SubgraphSampler(Mapper):
compacted_negative_tail
if
has_neg_dst
else
None
,
compacted_negative_tail
if
has_neg_dst
else
None
,
)
)
def
_sample_sub
_
graphs
(
self
,
seeds
):
def
_sample_subgraphs
(
self
,
seeds
):
raise
NotImplementedError
raise
NotImplementedError
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