DeepKNetwork.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:KanervaCoding 作者: JadenTravnik 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号