def __init__(self, pretrained_base_model=True): super(NIMA, self).__init__() base_model = mobile_net_v2(pretrained=pretrained_base_model) base_model = nn.Sequential(*list(base_model.children())[:-1]) self.base_model = base_model self.head = nn.Sequential(nn.ReLU(inplace=True), nn.Dropout(p=0.75), nn.Linear(1280, 10), nn.Softmax(dim=1))
def __init__(self, pretrained_base_model=True): super(NIMA, self).__init__() base_model = mobile_net_v2(pretrained=pretrained_base_model) base_model = nn.Sequential(*list(base_model.children())[:-1]) self.base_model = base_model self.head = nn.Sequential(nn.Linear(1280, 50), nn.ReLU(True), nn.Dropout(), nn.Linear(50, 1))
def __init__(self, pretrained_base_model=True): super(NIMA, self).__init__() base_model = mobile_net_v2(pretrained=pretrained_base_model) base_model = nn.Sequential(*list(base_model.children())[:-2]) self.base_model = base_model self.pool = nn.AvgPool2d(7) self.head = nn.Sequential(nn.ReLU(), nn.Dropout(p=0.75), nn.Linear(3681, 10), nn.Softmax(dim=1))