You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you've written the loss functions, did you calculate with batch data?
E.g. reading your tversky loss implementation, I think you've accidentally summed up everything aggregated over the batch instead of the data points.
For this reason your focal loss should make no difference to the simple tversky loss, because you raised the aggregated sum to the power of gamma. Instead, I believe you should raise the outputs to the power of gamma before the sum.
Of course if somehow your loss is calculated per a sample, than everything looks fine and keras made an automatic aggregation later, then everything looks fine.
The text was updated successfully, but these errors were encountered:
Hi,
When you've written the loss functions, did you calculate with batch data?
E.g. reading your tversky loss implementation, I think you've accidentally summed up everything aggregated over the batch instead of the data points.
When you do this, you sum up every prediction, but you actually want to calculate the loss for each image input.
Let me suggest the following:
For this reason your focal loss should make no difference to the simple tversky loss, because you raised the aggregated sum to the power of gamma. Instead, I believe you should raise the outputs to the power of gamma before the sum.
Of course if somehow your loss is calculated per a sample, than everything looks fine and keras made an automatic aggregation later, then everything looks fine.
The text was updated successfully, but these errors were encountered: