-
Notifications
You must be signed in to change notification settings - Fork 26
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
ODE计算代码问题 #9
Comments
TypeError: cannot assign 'torch.cuda.FloatTensor' as parameter 'w' (torch.nn.Parameter or None expected) |
font{
line-height: 1.6;
}
ul,ol{
padding-left: 20px;
list-style-position: inside;
}
font{
line-height: 1.6;
}
ul,ol{
padding-left: 20px;
list-style-position: inside;
}
Fixed
方正
***@***.***
签名由
网易邮箱大师
定制
在2022年01月18日 ***@***.***> 写道:
TypeError: cannot assign 'torch.cuda.FloatTensor' as parameter 'w' (torch.nn.Parameter or None expected)
—Reply to this email directly, view it on GitHub, or unsubscribe.Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
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 :
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
请问代码中的这段有详细解释吗?确保特征值小于1为什么这么做,为什么不是直接乘上一个可学习参数?
d = torch.clamp(self.d, min=0, max=1) w = torch.mm(self.w * d, torch.t(self.w)) w = (1 + self.beta) * w - self.beta * torch.mm(torch.mm(w, torch.t(w)), 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)) w2 = (1 + self.beta) * w2 - self.beta * torch.mm(torch.mm(w2, torch.t(w2)), w2) xw2 = torch.einsum('ijkl, km->ijml', x, w2)
The text was updated successfully, but these errors were encountered: