Skip to content

How T-Net is initialized as identity matrix? #108

Open
@adosar

Description

@adosar

According to the https://arxiv.org/abs/1612.00593 paper, the T-Net is initialized as identity matrix.

I fail to understand how this is the case when looking into the STNkd code.

If I understand correctly:

        iden = Variable(torch.from_numpy(np.eye(self.k).flatten().astype(np.float32))).view(1,self.k*self.k).repeat(batchsize,1)
        if x.is_cuda:
            iden = iden.cuda()
        x = x + iden
        x = x.view(-1, self.k, self.k)
        return x

This snippet adds the identity matrix to the regressed matrix. How the identity initialization is achieved?

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