Closed ghost closed 2 years ago
Thanks for your question. I believe I got 3 from the original paper. The best k depends on your dataset and your validation performance. You can indeed set k=1.
Thanks to your explanation, I'm confused because two other implementations anomalib and hcw-00 they both set the value of k to 9.
Fig.4 top in the paper, I'm not sure the 'neighborhood size' here is refer to the local neighborhood aggregation part (the Avgpool operation) or the k neighbor search operation...
I've always interpreted the local neighborhood aggregation part as avgpool part.
Thanks to your efforts, I've noticed in the code of patchcore, doing k nearest neighbor search, https://github.com/rvorias/ind_knn_ad/blob/5510f0f4bc1fc9688e57d20023985087f90f0f4d/indad/models.py#L286 the value of k is set to 3, can I ask how to determine the value of k? can I set k=1?