Closed HowCuteIsBee2002018 closed 6 months ago
Yes. I don't see any reason why you couldn't. Just add the accuracy to the outputs of training_epoch()
and the loss to the outputs of evaluate()
.
average_loss = training_epoch(
few_shot_classifier, train_loader, train_optimizer
)
train_losses.append(average_loss)
# Compute training accuracy after each epoch
train_accuracy = evaluate(
few_shot_classifier, train_loader, device=DEVICE, tqdm_prefix="Training"
)
train_accuracies.append(train_accuracy)
print(f"Training Accuracy: {train_accuracy:.4f}")
# Validation Phase
val_loss = evaluate(
few_shot_classifier, val_loader, device=DEVICE, tqdm_prefix="Validation"
)
val_losses.append(val_loss)
# Validation Accuracy
validation_accuracy = evaluate(
few_shot_classifier, val_loader, device=DEVICE, tqdm_prefix="Validation"
)
can it be like this or the validation loss need to use the training epoch function to calculate the val loss?
Problem I want to ask is it a must to visualize both losses and accuracies of training and validation? And if so then i wanted to have see both results but however, the episodic notebook only has training loss and validation accuracy. is it possible to have