Skip to content

About the first and second order gradient calculations in classification example #11

Description

@zebratiger4

Hi there,

In the implementation of classification example in Classification/main_cls_cv.py, the first and second order gradient calculations are calculated with the logic below

h = 1/((1+torch.exp(y*out))*(1+torch.exp(-y*out))), grad_direction = y * (1.0 + torch.exp(-y * out))

However, in the paper, the formula to calculate those gradients are $h_i = \frac{ 4 y^2_i e^{2y_i \hat{y}^{(t-1)}_i}}{\left (1+e^{2y_i \hat{y}^{(t-1)}_i} \right )^2}$, and $\tilde{y}_i = \frac{ y_i (1 + e^{-2y_i \hat{y}^{(t-1)}_i}) } {2} $.

Is there anything I may miss? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions