Beispiel #1
0
    def __init__(self, K, window_sampler, max_iter=10):
        self.K = K
        self.max_iter = max_iter
        self.windows = window_sampler.sample()
        self.window_offsets = window_sampler.get_window_offsets()
        self.feature_shape = window_sampler.feature_shape
        self.window_sampler = window_sampler

        # This is for learning
        self.input_acts = [[] for i in range(len(self.windows))]

        last_offset = self.window_offsets[-1]
        image_shape = (last_offset[0] + 1, last_offset[1] + 1)
        estimated_num_nodes = numpy.prod(image_shape) * K

        AndOrRegion.__init__(self, image_shape, estimated_num_nodes)

        self.init_Knodes()