def GetFeatures(self, data):
closestPrototypesIndxs = []
D = self.layers[0] - (np.array(data)*self.stateScale + self.bias)
D = np.sqrt(sum(D.T**2)) # a bottlenect for sure
indexes = np.argpartition(D, self.c[0], axis=0)[:self.c[0]]
for i in range(1,len(self.layers)):
D = np.sum(np.setxor1d(self.layers[i], indexes, True), axis=1)
# phi = np.zeros(self.prototypeList[i])
# phi[indexes] = 1
# D = np.sum(np.logical_xor(self.layers[i], phi), axis=1)
indexes = np.argpartition(D, self.c[i], axis=0)[:self.c[i]]
return indexes
评论列表
文章目录