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

no 'GraphAttention' function implementation #2

Open
jiyanbio opened this issue Dec 24, 2020 · 1 comment
Open

no 'GraphAttention' function implementation #2

jiyanbio opened this issue Dec 24, 2020 · 1 comment

Comments

@jiyanbio
Copy link

class SequenceModel(nn.Module):
def init(self, num_letters, hidden_dim, num_layers=3,
vocab=20, top_k=30, num_positional_embeddings=16):
""" Graph labeling network """
super(SequenceModel, self).init()

    # Hyperparameters
    self.top_k = top_k
    self.hidden_dim = hidden_dim
    self.positional_embeddings = PositionalEmbeddings(num_positional_embeddings)

    # Embedding layers
    self.W_e = nn.Linear(num_positional_embeddings, hidden_dim, bias=True)
    self.W_s = nn.Embedding(vocab, hidden_dim)

    # Decoder
    self.decoder_layers = nn.ModuleList([
        **GraphAttention(hidden_dim, hidden_dim*3)**
        for _ in range(2 * num_layers)
    ])
    self.W_out = nn.Linear(hidden_dim, num_letters, bias=True)

    # Initialization
    for p in self.parameters():
        if p.dim() > 1:
            nn.init.xavier_uniform_(p)
@jingraham
Copy link
Owner

Ah, thanks. This was due to an incomplete refactor of the module names. I started a patch here that should fix it and will merge when I can test the code.

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

2 participants