Raschka-research-group / coral-cnn

Rank Consistent Ordinal Regression for Neural Networks with Application to Age Estimation
https://www.sciencedirect.com/science/article/pii/S016786552030413X
MIT License
335 stars 62 forks source link

Coral cost function defferent with the definition in paper? #24

Closed xxxyyycc closed 4 years ago

xxxyyycc commented 4 years ago
def cost_fn(logits, levels, imp):
    val = (-torch.sum((F.logsigmoid(logits)*levels
                      + (F.logsigmoid(logits) - logits)*(1-levels))*imp,
           dim=1))
    return torch.mean(val)

The second term of the cost seems a little different from the original definition,could you explain it? thanks.