-
Notifications
You must be signed in to change notification settings - Fork 56
Seeking advice on a coding issue #44
Copy link
Copy link
Open
Description
In the 'shift' class within shift.py, why is it necessary to multiply the zero matrix created for xpos and ypos by 1.5? In the end, won't they both be zero anyway?
class Shift(Module):
def __init__(self, channel, stride, init_scale=3):
super(Shift, self).__init__()
self.stride = stride
self.xpos = Parameter(torch.zeros(channel,requires_grad=True,device='cuda')*1.5)#不知道这个乘以1.5有什么含义
self.ypos = Parameter(torch.zeros(channel,requires_grad=True,device='cuda')*1.5)
self.xpos.data.uniform_(-1e-8,1e-8)
self.ypos.data.uniform_(-init_scale,init_scale)
def forward(self, input):
return ShiftFunction.apply(input,self.xpos,self.ypos,self.stride)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels