示例#1
0
文件: run.py 项目: sbuschjaeger/gncl
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
示例#2
0
文件: run.py 项目: sbuschjaeger/gncl
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)