def init_protonet(opt):
    '''
    Initialize the ProtoNet
    '''
    model = ProtoNet()
    model = model.cuda() if opt.cuda else model
    return model
예제 #2
0
def init_protonet(opt):
    '''
    Initialize the ProtoNet
    '''
    if opt.dataset == 'omniglot':
        model = ProtoNet()
    elif opt.dataset == 'mini_imagenet':
        model = ProtoNet(x_dim=3)
    model = model.cuda() if opt.cuda else model
    return model
예제 #3
0
def create_model():
    protonet_model = ProtoNet()
    if use_gpu:
        protonet_model = protonet_model.cuda()
    return protonet_model