Skip to content

loss functions return wrong values #160

@glample

Description

@glample

The following code outputs:
4, 0.4, 4
instead of
4, 0.4, 0.04

and there seem to be errors for other loss functions as well, like SmoothL1Loss.

loss = nn.L1Loss()
y = Variable(torch.FloatTensor(1).fill_(0))
print(loss.forward(Variable(torch.FloatTensor(1).fill_(4.)), y))
print(loss.forward(Variable(torch.FloatTensor(1).fill_(.4)), y))
print(loss.forward(Variable(torch.FloatTensor(1).fill_(.04)), y))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions