-
Cosine-similarity Classifier; PyTorch ImplementationData/Machine learning 2021. 3. 17. 11:10
Cosine-similarity Classifier introduced in [S. Gidaris et al., 2018] is implemented here. The cosine-similarity classifier is compared to the linear-softmax classifier. The codes can be found in my Github. [W. Chen et al., 2020] verifies the performance improvement by the cosine-similarity classifier in the few-shot learning regime.
Result; In the one-shot learning regime
The models are trained on the MNIST dataset in which data corresponding to 7 is left out as a novel class. During the test, one data for the novel class 7 is given, and the classification accuracies of both models are presented:
(Left) cosine-similarity classifier, (Right) linear classifier
Since the cosine-similarity classifier takes the prototype approach, it doesn't need to be fine-tuned. Therefore, it does not degrade its classification performance for the base classes. However, the linear classifier needs to be fine-tuned and degrades its original performance for the base classes.
'Data > Machine learning' 카테고리의 다른 글
Variational Auto Encoder (VAE) (0) 2021.03.19 Dilated Causal Convolution from WaveNet (0) 2021.03.01 [PyTorch] .detach() (0) 2021.01.28