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

关于数据的标签,我有一些疑惑? #3

Open
tiandamiao opened this issue Oct 20, 2020 · 0 comments
Open

关于数据的标签,我有一些疑惑? #3

tiandamiao opened this issue Oct 20, 2020 · 0 comments

Comments

@tiandamiao
Copy link

tiandamiao commented Oct 20, 2020

在Ganomaly中,我对代码的label设置有一些疑惑,想咨询一下你
1、在数据预处理中,正常样本的标签设置为0

#####Assign labels to normal (0) and abnormals (1)
nrm_trn_lbl[:] = 0
nrm_tst_lbl[:] = 0
abn_trn_lbl[:] = 1
bn_tst_lbl[:] = 1

2、在训练过程中,正常样本的预测值和self.real_label比较,self.real_label的值为1.
def backward_d(self):
""" Backpropagate through netD
"""
#####Real - Fake Loss
self.err_d_real = self.l_bce(self.pred_real, self.real_label)
self.err_d_fake = self.l_bce(self.pred_fake, self.fake_label)`

我对这一点,很是不解。为什么反向传播时的正常样本预测值self.pred_real要和标签值self.real_label=1比较???看到你有重现这个代码,能给我说说你的理解吗?
我的联系方式(QQ):631314045.
有偿解答也可以,希望得到你的回复。

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