mahmoodlab / HIPT

Hierarchical Image Pyramid Transformer - CVPR 2022 (Oral)
Other
509 stars 89 forks source link

knn_classifier #54

Open xjc6666 opened 1 year ago

xjc6666 commented 1 year ago

def knn_classifier(train_features, train_labels, test_features, test_labels, k, T, num_classes=2),The function is given a parameter of num_classes of 1000, when this value is changed to 2 and the binary classification problem is performed, an error is reported: RuntimeError: start (0) + length (5) exceeds dimension size (2). How should I use knn for binary classification problem?