Prechádzať zdrojové kódy

call method of the separate model classifier is now abstact. this way using this class needs to be defined, how the different models handle the inputs

Dimitri Korsch 4 rokov pred
rodič
commit
9f143ab908
1 zmenil súbory, kde vykonal 6 pridanie a 1 odobranie
  1. 6 1
      cvfinetune/classifier.py

+ 6 - 1
cvfinetune/classifier.py

@@ -1,9 +1,10 @@
+import abc
 import chainer
 import chainer.functions as F
 import chainer.links as L
+import logging
 
 from chainer_addons.models.classifier import Classifier as C
-import logging
 
 class Classifier(C):
 
@@ -34,6 +35,10 @@ class SeparateModelClassifier(Classifier):
 		with self.init_scope():
 			self.init_separate_model()
 
+	@abc.abstractmethod
+	def __call__(self, *args, **kwargs):
+		super(SeparateModelClassifier, self).__call__(*args, **kwargs)
+
 	def init_separate_model(self):
 
 		if hasattr(self, "separate_model"):