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

Error in Inverse_Sigmoid_Loss ?? #41

Open
JoyMaz222 opened this issue Dec 9, 2021 · 0 comments
Open

Error in Inverse_Sigmoid_Loss ?? #41

JoyMaz222 opened this issue Dec 9, 2021 · 0 comments

Comments

@JoyMaz222
Copy link

JoyMaz222 commented Dec 9, 2021

Hi, I was looking into the code and found some mismatch in Inverse_Sigmoid_Loss function.

class Inverse_Sigmoid_Loss(nn.Module):
	def __init__(self):
		super(Inverse_Sigmoid_Loss, self).__init__()

	def forward(self, prediction, target, weight=None):
		trans_prediction = 1 / torch.sigmoid(target) - 1
		loss = F.l1_loss(trans_prediction, target, reduction='none')
		
		if weight is not None:
			loss = loss * weight

		return loss

This looks odd to me. trans_prediction is calculated from target and L1 loss is calculated between trans_prediction and target which doesn't make sense. variable prediction wasn't even used in this function. Any explanation for that ? Thanks

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