Open InTheFuture7 opened 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)
Perhaps the range of values for the loss function may be [0, +∞].