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

Angular loss #33

Open
Katherinexx opened this issue Jan 15, 2019 · 0 comments
Open

Angular loss #33

Katherinexx opened this issue Jan 15, 2019 · 0 comments

Comments

@Katherinexx
Copy link

Katherinexx commented Jan 15, 2019

hi Mr. Hu:
I reimplement your work on mxnet, the same operation as yours in loss function. But I find that it's easy for 'dot' parameter out of range [-safe_v, safe_v], so that the loss will be the same for lots of images, and the loss will not decrease. However, without clip 'dot', the loss will be 'nan'. I change the loss to be l2 loss, the loss decrease normally.
I wonder why you set 'safe_v' parameters here, and how to avoid the 'dot' parameter out of range to make loss decrease.
Thanks a lot!

Here is my loss function:

    safe_v = 0.999999
    illum_normalized = F.L2Normalization(pred)
    _ilum_normalized = F.L2Normalization(label)
    dot = F.sum(illum_normalized*_ilum_normalized)
    dot = F.clip(dot, -safe_v, safe_v)
    angle = F.arccos(dot)*(180 / math.pi)
    mean_angle = F.mean(angle)
    return mean_angle
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

1 participant