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

activation after each FC layer in TopNet #16

Open
CuiRuikai opened this issue Nov 6, 2021 · 0 comments
Open

activation after each FC layer in TopNet #16

CuiRuikai opened this issue Nov 6, 2021 · 0 comments

Comments

@CuiRuikai
Copy link

class MLP(nn.Module):
    def __init__(self, dims,  bn=None):
        super().__init__()
        self.model = nn.Sequential()
        for i, num_channels in enumerate(dims[:-2]):
            self.model.add_module('fc_%d' % (i+1), nn.Linear(num_channels, dims[i+1]))
        self.bn = bn
        if self.bn:
            self.batch_norm = nn.BatchNorm1d(dims[-2])
        self.output_layer = nn.Linear(dims[-2], dims[-1])

    def forward(self, features):
        features = self.model(features)
        if self.bn:
            features = self.batch_norm(features)
        features = F.relu(features)
        outputs = self.output_layer(features)
        return outputs

for this implementation, it looks that there's no activation function after each fc layer. There is only one activation at the end

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