Skip to content

Seeking advice on a coding issue #44

@ldfgood

Description

@ldfgood

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions