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

Variables not defined #3

Open
gkiril opened this issue Nov 11, 2020 · 1 comment
Open

Variables not defined #3

gkiril opened this issue Nov 11, 2020 · 1 comment

Comments

@gkiril
Copy link

gkiril commented Nov 11, 2020

Some variables in CaRe_main.py are not defined. For instance, in this code snippet:

if self.args.CN=='LAN':
   self.cn = CaRe(self.args.nfeats, self.args.nfeats)
elif self.args.CN=='GCN':
   self.cn = CaReGCN(self.args.nfeats, self.args.nfeats)
else:
   self.cn = CaReGAT(self.args.nfeats, self.args.nfeats//self.args.nheads, heads=self.args.nheads, dropout=self.args.dropout)

the variables CaRe, CaReGCN and CaReGAT are not defined anywhere in the code, which leads to the exception NameError:

Traceback (most recent call last):
  File "CaRe_main.py", line 237, in <module>
    main(args)
  File "CaRe_main.py", line 114, in main
    model = ConvEParam(args,data.embed_matrix,data.rel2word)
  File "CaRe_main.py", line 23, in __init__
    self.cn = CaRe(self.args.nfeats, self.args.nfeats)
NameError: name 'CaRe' is not defined

How can this be solved? Is it possible that parts of the code are actually not available on this repo?

@anindyasdas
Copy link

It seemed to me typos! It does not matter what is the baseline embedding (TransE/Conv), the algorithm logic is same:
so instead of this:

if self.args.CN=='LAN':
        	self.cn = CaRe(self.args.nfeats, self.args.nfeats)
        elif self.args.CN=='GCN':
        	self.cn = CaReGCN(self.args.nfeats, self.args.nfeats)
        else:
        	self.cn = CaReGAT(self.args.nfeats, self.args.nfeats//self.args.nheads, heads=self.args.nheads, dropout=self.args.dropout)

do the following:

if self.args.CN=='LAN':
        	self.cn = LAN(self.args.nfeats, self.args.nfeats)
        elif self.args.CN=='GCN':
        	self.cn = GCN(self.args.nfeats, self.args.nfeats)
        else:
        	self.cn = GAT(self.args.nfeats, self.args.nfeats//self.args.nheads, heads=self.args.nheads, dropout=self.args.dropout)

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