Переглянути джерело

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 роки тому
батько
коміт
9f143ab908
1 змінених файлів з 6 додано та 1 видалено
  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"):