Преглед на файлове

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"):