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

Some confusion for case 'stride = 2' #25

Open
shuizidesu opened this issue Aug 30, 2022 · 0 comments
Open

Some confusion for case 'stride = 2' #25

shuizidesu opened this issue Aug 30, 2022 · 0 comments

Comments

@shuizidesu
Copy link

Dear authors:

The forward procedure for $i$-RevNet described in the paper (Eq.(1)) is:

$$ \tilde{x}{j+1} = x{j} + F_{j+1} \tilde{x}_{j} $$

However, the code for case 'stride = 2' leads to the following form:

class irevnet_block(nn.Module):
...
    def forward(self, x):
        """ bijective or injective block forward """
        if self.pad != 0 and self.stride == 1:
            x = merge(x[0], x[1])
            x = self.inj_pad.forward(x)
            x1, x2 = split(x)
            x = (x1, x2)
        x1 = x[0]
        x2 = x[1]
        Fx2 = self.bottleneck_block(x2)
        if self.stride == 2:
            x1 = self.psi.forward(x1)
            x2 = self.psi.forward(x2)
        y1 = Fx2 + x1
        return (x2, y1)

which means

$$ \tilde{x}{j+1} = {S}{j+1}x_{j} + F_{j+1} \tilde{x}_{j} $$

Whether I understand correctly? It is appreciated that answering my question in your busy time.

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