def stacking_classifier(model_type): classifier = torch.nn.Linear(16*10,10) if "binary" == model_type: return BinaryModel(classifier, keep_activation=True) else: return classifier
def simpleresnet(size, model_type): if "small" == size: n_channels = 32 depth = 4 else: n_channels = 96 depth = 4 if "binary" == model_type: return BinaryModel(SimpleResNet(in_channels = 1, n_channels = n_channels, depth = depth, num_classes=10), keep_activation=True) else: return SimpleResNet(in_channels = 1, n_channels = n_channels, depth = depth, num_classes=10)