is this correct for binary classification problem?
            if val_acc > best_pred: 
                best_pred = val_acc
                best_epoch = epoch
                best_preds = val_preds
                best_val_labels = val_labels
                if not test:
                    print("saving model...")
                    torch.save(model.state_dict(), model_path + task_name + ".pth")