Closed niyunsheng closed 4 years ago
I can calculating the value of phi using the code as follows:
cosine = F.linear(F.normalize(feature), F.normalize(self.weight)) theta = cosine.acos() _phi = theta*m k = _phi / torch.Tensor([np.pi]) k = k.floor() _phi = _phi + torch.Tensor([np.pi])*k _phi = _phi.cos() - k
is there any wrong? i think it's a better code by myself
I can calculating the value of phi using the code as follows:
is there any wrong? i think it's a better code by myself