Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not possible to sample twice along same edge_set? #827

Open
cgparkinson opened this issue Aug 5, 2024 · 0 comments
Open

Not possible to sample twice along same edge_set? #827

cgparkinson opened this issue Aug 5, 2024 · 0 comments

Comments

@cgparkinson
Copy link

Hi,

I have a heterogeneous graph where I would like to sample twice along the same edge set, i.e. starting from A we can reach B, C, D, E, F, G:

  B - C
 / \
A - D - E
 \
  F - G

This should be possible, according to the documentation:

# Store builder at level of "author written papers":
builder = tfgnn.SamplingSpecBuilder(schema).seed('author').sample(10, 'writes')
path1 = builder.sample(5, 'cited_by')
path2 = builder.sample(3, 'written_by').sample('writes')

proto = (tfgnn.SamplingSpecBuilder.join([path1, path2]).sample(10, 'cited_by')
         .build())

# The above `Join()` can be made less verbose with:
proto = path1.Join([path2]).sample(10, 'cited_by').build()

In the above example, cited_by is clearly used twice.

However when I try this I get the error message:

ValueError: The name ... is used 2 times in the model. All layer names should be unique.

To reproduce:

I can easily reproduce this in the ogbn notebook, by replacing:

  papers_cited_from_seed = seed.sample(sizes["cites"], "cites")

with

  papers_cited_from_seed = seed.sample(sizes["cites"], "cites").sample(sizes["cites"], "cites")

or equivalently

  papers_cited_from_seed = seed.sample([sizes["cites"], sizes["cites"]], "cites")

to obtain the error:

ValueError: The name "cites" is used 2 times in the model. All layer names should be unique.

Is this a bug or is this intentional? It's possible I'm thinking along the wrong lines.

Many thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant