File size: 267 Bytes
bc45d7d
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import torch.nn as nn
import timm


class CNN(nn.Module):
    def __init__(self, config):
        super().__init__()
        self.model = timm.create_model(config.model, pretrained=True, num_classes=0)

    def forward(self, x):
        return self.model(x).detach()