def __get_densenet121(self): model = models.densenet121(pretrained=True) for param in model.parameters(): param.requires_grad = False self.architecture["input"] = model.classifier.in_features model.classifier = Network(self.architecture) return model
def __get_inception(self): model = models.inception_v3(pretrained=True) for param in model.parameters(): param.requires_grad = False self.architecture["input"] = model.fc.in_features model.classifier = Network(self.architecture) return model
def __get_vgg16(self): model = models.vgg16(pretrained=True) for param in model.parameters(): param.requires_grad = False self.architecture["input"] = model.classifier[0].in_features # TODO: Validate classifier architecture? model.classifier = Network(self.architecture) return model