Closed realliyifei closed 1 year ago
Hi. The online knn is defined here: https://github.com/vturrisi/solo-learn/blob/main/solo/methods/base.py#L252-L255
thanks by the code the default setting for online knn seems to be: k=20, T= 0.07, distance_func=euclidean.
It would be good to also know what is the knn setting you used for the offline performance in readme
@DonkeyShot21 Will probably know that.
In general, parameters for the linear evaluation and knn are tuned on the test set in SSL. However, the default parameters are quite strong, you should not see a big gap in performance. Not sure why the default is euclidian for the distance function, it should be cosine
RE distance func: I saw this line is euclidian
but yes I agree cosine
should be the default, which is what I am using
RE parameters: different, reasonable parameters of knn cause ~1 point on top-1 accuracy of imagenet on my side, so while it may not be that strong, the gap is still noticeable
Overall these are the valuable information, thanks! So it sounds like different models' performances on the readme use different optimal knn parameters respectively? I assumed they use the same setting to compare.
I am not 100% sure, but they should have been tuned for each model, resulting in different parameters.
i see. thanks!
What is the setting for offline and online KNN in the readme?
For offline KNN, the gridsearch is implemented here (k, temperature, feature_type, distance_function): do you use the setting of the best performance for each model respectively? Or do you stick to a good setting for all models?
For online KNN, a similar question as above is raised.