Beispiel #1
0
    def prepare_for_inference(self):
        """ Sets up the AndOrRegion nodes, but also trains the K means. """
        AndOrRegion.prepare_for_inference(self)

        # Train the K means
        self.kmeans_learners = []
        for widx in range(len(self.windows)):
            train_data = numpy.array(self.input_acts[widx], "float32")
            kfl = KmeansFeatureLearner(self.K, train_data, max_iter=self.max_iter)
            self.kmeans_learners.append(kfl)