Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adaptive算法实现有问题? #12

Closed
serend1p1ty opened this issue Mar 11, 2019 · 1 comment
Closed

Adaptive算法实现有问题? #12

serend1p1ty opened this issue Mar 11, 2019 · 1 comment

Comments

@serend1p1ty
Copy link

serend1p1ty commented Mar 11, 2019

嗨,您好,我最近在研究AliPy的代码。(multilabel.py 1037-1045行)

pos[br_real < 0] = 1

这里的Adaptive算法实现似乎有点小问题。
设想这么一种情况,br_real矩阵每个元素都是2,那么pos矩阵的结果可能为负数。
参考原论文
image
可知,pos不可能存在负数。
这里忽略了br_real元素都大于0的情况。同样,下面在计算neg的时候也有同样的问题。

@Lggggggx
Copy link
Collaborator

感谢反馈,这确实有问题,已经在dev分支上进行了修改。

        pos = np.copy(br_real)
        pos[br_real < 0] = 1
        pos = np.max((1. - pos), axis=1)
        pos = np.array([0 if i<0 else i for i in pos])

        neg = np.copy(br_real)
        neg[br_real > 0] = -1
        neg = np.max((1. + neg), axis=1)
        neg = np.array([0 if i<0 else i for i in neg])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants