I have sent my output to softmax function  and I am getting positive value in range(0,1)


I have inference code for taking multiple images in a folder, there I don’t have loss function(Cross entropy) neither Softmax Do I want to add cross entropy in my inference code? or it is ok


By adding softmax in my inference code will there be any change in my prediction or its(softmax) just used to convert logit into probability?


here is the code for Inference
    import torchvision
    import torchvision.transforms as transforms
    import torchvision.datasets as datasets
    normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406],
                std=[1./255., 1./255., 1./255.])

    torchvision.set_image_backend('PIL')

    data_transforms = {
    'predict': transforms.Compose([
        transforms.Resize((256, 256)),
        transforms.CenterCrop(input_size),
        transforms.ToTensor(),
        normalize,
        ])
    }

    dataset = {'predict' : datasets.ImageFolder("/content/XNOR-Net-PyTorch/ImageNet/networks/", data_transforms['predict'])}
    dataloader = {'predict': torch.utils.data.DataLoader(dataset['predict'], batch_size=args.batch_size, shuffle=False, num_workers=args.workers,pin_memory=True)}
batch_time = AverageMeter()
    losses = AverageMeter()
    top1 = AverageMeter()
    top5 = AverageMeter()

    model.eval()
    end = time.time()
    global bin_op
    bin_op = util.BinOp(model)
    bin_op.binarization()
    #input=img

    for input, labels in dataloader['predict']:
      with torch.no_grad():
        input_var = torch.autograd.Variable(input)
        
        
    # compute output
      output = model(input_var)