[QA] Remove unused argument from CBC

This commit is contained in:
Alexander Engelsberger 2021-06-07 21:00:58 +02:00
parent c7b5c88776
commit 43fc7d1678

View File

@ -2,24 +2,15 @@ import torch
import torchmetrics import torchmetrics
from .abstract import ImagePrototypesMixin from .abstract import ImagePrototypesMixin
from .extras import ( from .extras import (CosineSimilarity, MarginLoss, ReasoningLayer,
CosineSimilarity, euclidean_similarity, rescaled_cosine_similarity,
MarginLoss, shift_activation)
ReasoningLayer,
euclidean_similarity,
rescaled_cosine_similarity,
shift_activation,
)
from .glvq import SiameseGLVQ from .glvq import SiameseGLVQ
class CBC(SiameseGLVQ): class CBC(SiameseGLVQ):
"""Classification-By-Components.""" """Classification-By-Components."""
def __init__(self, def __init__(self, hparams, margin=0.1, **kwargs):
hparams,
margin=0.1,
similarity=euclidean_similarity,
**kwargs):
super().__init__(hparams, **kwargs) super().__init__(hparams, **kwargs)
self.margin = margin self.margin = margin
self.similarity_fn = kwargs.get("similarity_fn", euclidean_similarity) self.similarity_fn = kwargs.get("similarity_fn", euclidean_similarity)