Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about affinity matrix #54

Open
lizechng opened this issue Nov 3, 2022 · 0 comments
Open

Question about affinity matrix #54

lizechng opened this issue Nov 3, 2022 · 0 comments

Comments

@lizechng
Copy link

lizechng commented Nov 3, 2022

Hi, i'm very interested in your excellent work, but confused on the affinity matrix....
At the code

guidance = self.gud_up_proj_layer6(x)

guidance = self.gud_up_proj_layer6(x)

class Simple_Gudi_UpConv_Block_Last_Layer(nn.Module):
    def __init__(self, in_channels, out_channels, oheight=0, owidth=0):
        super(Simple_Gudi_UpConv_Block_Last_Layer, self).__init__()
        self.conv1 = nn.Conv2d(in_channels, out_channels, kernel_size=3, stride=1, padding=1, bias=False)
        self.oheight = oheight
        self.owidth = owidth
        self._up_pool = Unpool(in_channels)

    def _up_pooling(self, x, scale):

        x = self._up_pool(x)
        if self.oheight != 0 and self.owidth != 0:
            x = x.narrow(2, 0, self.oheight)
            x = x.narrow(3, 0, self.owidth)
        return x

    def forward(self, x):
        x = self._up_pooling(x, 2)
        out = self.conv1(x)
        return out

in function _up_pooling, with self._up_pool(x), the shape of x should be [batch, 8, 228*2, 304*2]
and

x = x.narrow(2, 0, self.oheight)
x = x.narrow(3, 0, self.owidth)

the guidance feature's shape should be [batch, 8, 228, 304]

Why the guidance feature only retain the left-top area?

Looking forward to your reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant