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

[Question] How to define a parameter based on a defined one #182

Open
minhtriet opened this issue Mar 5, 2023 · 3 comments
Open

[Question] How to define a parameter based on a defined one #182

minhtriet opened this issue Mar 5, 2023 · 3 comments

Comments

@minhtriet
Copy link

In config.gin, I cannot do something like

GAT.embed_dim = 30     # this is for init of GAT

Attention.node_ft_dim = GAT.__init__.embed_dim
# Attention.node_ft_dim = GAT.embed_dim      # this won't work too

It won't work even when I

@gin.register
@gin.configurable
class GAT(nn.Module):

Is this feature implemented?

@marcospiau
Copy link

@minhtriet Same here, was looking for this feature!

@alexd314
Copy link

alexd314 commented May 3, 2023

A workaround for this might be to use a MACRO

EMBED_DIM = 30

GAT.embed_dim = %EMBED_DIM
Attention.node_ft_dim = %EMBED_DIM

@Bloos
Copy link

Bloos commented Mar 22, 2024

is there a way to do calculations with macros like this?

EMBED_DIM = 30

GAT.embed_dim = 2*%EMBED_DIM

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

4 participants