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

Question about the loss funvtion #8

Open
xiaoyiming opened this issue Mar 26, 2019 · 2 comments
Open

Question about the loss funvtion #8

xiaoyiming opened this issue Mar 26, 2019 · 2 comments

Comments

@xiaoyiming
Copy link

The cost function is defined as follows,in your codes:
def audio_discriminate_loss2(gamma=0.1,beta = 20.1,num_speaker=2):
def loss_func(S_true,S_pred,gamma=gamma,beta=beta,num_speaker=num_speaker):
sum_mtr = K.zeros_like(S_true[:,:,:,:,0])
for i in range(num_speaker):
sum_mtr += K.square(S_true[:,:,:,:,i]-S_pred[:,:,:,:,i])
for j in range(num_speaker):
if i != j:
sum_mtr -= gamma
(K.square(S_true[:,:,:,:,i]-S_pred[:,:,:,:,j]))
for i in range(num_speaker):
for j in range(i+1,num_speaker):
#sum_mtr -= betaK.square(S_pred[:,:,:,i]-S_pred[:,:,:,j])
#sum_mtr += beta
K.square(S_true[:,:,:,:,i]-S_true[:,:,:,:,j])
pass
#sum = K.sum(K.maximum(K.flatten(sum_mtr),0))
loss = K.mean(K.flatten(sum_mtr))
return loss
return loss_func
However, I do not understand the meaning of this parts:
for j in range(num_speaker):
if i != j:
sum_mtr -= gamma*(K.square(S_true[:,:,:,:,i]-S_pred[:,:,:,:,j]))
I guess you want to use the permutation invariant (PIT) loss, but the definition of PIT is not like that. what is the meaning of this part?

@bill9800
Copy link
Owner

You can see the detail in C.Training Objectives on page 4-5.
Joint Optimization of Masks and Deep Recurrent Neural Networks for Monaural Source Separation, P. Hunag et al,arXiv:1502.04149v4 [cs.SD] 1 Oct 2015

@xiaoyiming
Copy link
Author

Thanks for replay!! I will chick it .

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