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

请问center_loss.py中每个label的center是如何更新的? #1

Open
LeeJuly30 opened this issue Apr 10, 2018 · 7 comments
Open

Comments

@LeeJuly30
Copy link

您好,我在center_loss.py里没有看到有关center的更新,只是在每次forward的时候传入center
但是在main,pyforward的时候loss_center = center_loss(features, label)也没有传入center,不知道在训练的时候每个label的center是如何更新的?
感谢帮助

@ShownX
Copy link
Owner

ShownX commented Apr 10, 2018

Hi,

The centers are maitained in the in parameters in CenterLoss class.
As we know, the centers are updated when the network backpropagates.
In MXNet, it automatically computes the gradients and update the parameters (managed in autograd package). It does not require you to update the centers manually.

Does it anwer your question?

@LeeJuly30
Copy link
Author

但是基于TensorFlow的实现都设置了centerstrainable=False,然后利用每个batch的数据去更新每个label的center,而不是利用bp反传的梯度更新center,而且我感觉直接用数据更新center而不是用梯度更新更make sense - -

@zhyj3038
Copy link

zhyj3038 commented Apr 23, 2018

会更新中心的。你就认为最终的聚类中心是最优点,每一次反向传播时候,使用梯度下降法使得当前的聚类中心向最优点移动。

@yanglong-intellif
Copy link

center最初是怎么计算出来的,在哪里实现的?

@wangx404
Copy link

有个center class,里面存储的就是feature center,最初是随机初始化得到的。

@wangx404
Copy link

wangx404 commented Dec 3, 2018

center最初是怎么计算出来的,在哪里实现的?

我用另一种方式实现了center loss,欢迎使用讨论。

@wangx404
Copy link

wangx404 commented Mar 27, 2019

in line 77 and 79 in main.py, there is a little problem.

fpath=os.path.join(args.out_dir, '%s-train-epoch-%s.png' % (args.prefix, e)))

Isn't it better to use "epoch-%d.png" rather than "epoch-%s.png"?

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

5 participants