Skip to content
This repository has been archived by the owner on Jun 22, 2022. It is now read-only.

wrong cross entropy definition #3

Open
kamil-kaczmarek opened this issue May 23, 2018 · 0 comments
Open

wrong cross entropy definition #3

kamil-kaczmarek opened this issue May 23, 2018 · 0 comments
Labels

Comments

@kamil-kaczmarek
Copy link
Member

cross_entropy function: https://github.com/minerva-ml/steppy-toolkit/blob/master/steppy_toolkit/pytorch/validation.py#L24 probably should be defined in a slightly different way:

def cross_entropy(output, target, squeeze=False):
    if squeeze:
        target = target.squeeze(1)
    return F.nll_loss(F.log_softmax(output), target)

Please verify.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant