Skip to content

why do we need self.adjust and self.bias in BoxTower? #14

Description

@hajungong007
    # adjust scale
    self.adjust = nn.Parameter(0.1 * torch.ones(1))
    self.bias = nn.Parameter(torch.Tensor(1.0 * torch.ones(1, 4, 1, 1)))

def forward(self, search, kernel, update=None):
    # encode first
    if update is None:
        cls_z, cls_x = self.cls_encode(kernel, search)  # [z11, z12, z13]
    else:
        cls_z, cls_x = self.cls_encode(update, search)  # [z11, z12, z13]

    reg_z, reg_x = self.reg_encode(kernel, search)  # [x11, x12, x13]

    # cls and reg DW
    cls_dw = self.cls_dw(cls_z, cls_x)
    reg_dw = self.reg_dw(reg_z, reg_x)
    x_reg = self.bbox_tower(reg_dw)
    x = self.adjust * self.bbox_pred(x_reg) + self.bias
    x = torch.exp(x)

    # cls tower
    c = self.cls_tower(cls_dw)
    cls = 0.1 * self.cls_pred(c)

    return x, cls, cls_dw, x_reg

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions