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

Adaboost里的Zm为什么是Sum(D)? #18

Open
MaoShuyi opened this issue Aug 20, 2020 · 1 comment
Open

Adaboost里的Zm为什么是Sum(D)? #18

MaoShuyi opened this issue Aug 20, 2020 · 1 comment

Comments

@MaoShuyi
Copy link

代码:D = np.multiply(D, np.exp(-1 * alpha * np.multiply(trainLabelArr, Gx))) / sum(D)

书里公式中分母应该是Zm,但是代码里是 sum(D),不是很清楚。

@ChestnutSilver
Copy link

ChestnutSilver commented Oct 26, 2023

根据Zm的公式,Zm的计算方法即为sum(D)

    #D是一个行向量,由wmi元素组成,然后D中元素求和为Zm,Zm规范化因子使得D是一个分布
    D = np.multiply(D, np.exp(-1 * alpha * np.multiply(trainLabelArr, Gx)))
    Zm = sum(D)
    D = D / Zm

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