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

bug in ODEFnc() #11

Open
jiangxinke opened this issue Jan 18, 2022 · 2 comments
Open

bug in ODEFnc() #11

jiangxinke opened this issue Jan 18, 2022 · 2 comments

Comments

@jiangxinke
Copy link

There is a bug in ODEFnc(), for the Parameter can not be augmented assignment directly, or else it would have an error "cannot assign ‘torch.cuda.FloatTensor’ as parameter ‘self.w’ (torch.nn.Parameter or None expected)"

it should be :

        self.w.data = (1 + self.beta) * self.w - self.beta * torch.mm(torch.mm(self.w, torch.t(self.w)), self.w)
        xw = torch.einsum('ijkl, lm->ijkm', x, w)

        d2 = torch.clamp(self.d2, min=0, max=1)
        w2 = torch.mm(self.w2 * d2, torch.t(self.w2))
        self.w2.data = (1 + self.beta) * self.w2 - self.beta * torch.mm(torch.mm(self.w2, torch.t(self.w2)), self.w2)
@square-coder
Copy link
Owner

You are right, but we found such operation led to suboptimal convergence. And a simple alternative is to just delete this line, which means we don’t constrain $self.w$ to be orthogonal, and it works in practice. We have fixed the bug in this way.
Thanks for your attention.

@jiangxinke
Copy link
Author

tks

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