ioannislivieris / Grad_CAM_Siamese

6 stars 1 forks source link

Does the loss function's value range typically extend from 0 to positive infinity? #2

Open InTheFuture7 opened 1 month ago

InTheFuture7 commented 1 month ago
# setup loop with TQDM and dataloader
loop = tqdm(test_dl, leave=True)
# setup epoch's metrics
metrics = {'losses': [], 'accuracy': [], 'AUC': []}
for step, (img1, img2, labels) in enumerate(loop):
    img1, img2, labels = img1.to(device), img2.to(device), labels.to(device)
    # Get loss & predictions
    predictions, loss = model(img1, img2, labels)  # here
    # Calculate performance metrics
    accuracy, AUC, _ = performance_evaluation(labels, predictions)               
    # Add loss/accuracy/AUC
    metrics['losses'].append(loss.item())
    metrics['accuracy'].append(accuracy)
    metrics['AUC'].append(AUC)   
InTheFuture7 commented 1 month ago

Perhaps the range of values for the loss function may be [0, +∞].

Snipaste_2024-05-31_21-27-35