Skip to content

convolution encoder better result then vit #14

@Alexandr1111111

Description

@Alexandr1111111

Thank you for this work.
The generalizing ability of neural networks based on convolution layers is much greater.

class Model(torch.nn.Module):
    def __init__(self):
        super(Model, self).__init__()
        from efficientnet_pytorch import EfficientNet
        self.model = EfficientNet.from_pretrained('efficientnet-b4')
        self.model = EfficientNet.from_pretrained('efficientnet-b4')
        self.model._fc = torch.nn.Linear(1792, 1024)
        self.conv1D = torch.nn.Conv1d(1, 128, 3, padding='same')

    def forward(self, x):
        
        x = self.model(x)
        x = torch.unsqueeze(x, 1)
        x = self.conv1D(x)
        # return (batch, seq, dim)
        return x

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