예제 #1
0
class MockSkorchNet:
    def __init__(self):
        self.device = "cpu"
        self.forward_iter = None
        self.history = History()
        self.history.new_epoch()
        self._default_callbacks = []

    def fit(self, X, y=None):
        return self

    def predict(self, X):
        return np.concatenate(
            [to_numpy(x.argmax(1)) for x in self.forward_iter(X)], 0)

    def get_iterator(self, X_test, training):
        return DataLoader(X_test, batch_size=2)
예제 #2
0
 def __init__(self):
     self.device = "cpu"
     self.forward_iter = None
     self.history = History()
     self.history.new_epoch()
     self._default_callbacks = []