mlutils.py 文件源码

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

项目:hco-experiments 作者: zooniverse 项目源码 文件源码
def signPreserveNorm(self):
        """
            This is a sign preserving nomalisation used in Eye.
            Similar to that used by Romano et al. in SVM paper
            except they use log(1+|x|) i.e. don't divide by sigma.
            nomalizes the unraveled image

            vectorized on 24/07/13
            """
        #shape = np.shape(self.getObject())
        Vec = np.nan_to_num(np.ravel(self.getImage(), order="F"))
        #normVec = np.zeros((np.shape(Vec)))
        std = np.std(Vec)
        #for i in range(len(Vec)):
        #    # log1p returns the natural log of (1+x)x
        #    normVec[i] += ((Vec[i])/ np.abs(Vec[i]))*(np.log1p(np.abs(Vec[i])/std))
        #    #print normVec[i]
        normVec = ((Vec)/ np.abs(Vec))*(np.log1p(np.abs(Vec)/std))
        return normVec
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号