def loss_fn(outputs, labels):
    '\n    Compute the cross entropy loss given outputs and labels.\n\n    Args:\n        outputs: (Variable) dimension batch_size x 6 - output of the model\n        labels: (Variable) dimension batch_size, where each element is a value in [0, 1, 2, 3, 4, 5]\n\n    Returns:\n        loss (Variable): cross entropy loss for all images in the batch\n\n    Note: you may use a standard loss function from http://pytorch.org/docs/master/nn.html#loss-functions. This example\n          demonstrates how you can easily define a custom loss function.\n    '
    return nn.CrossEntropyLoss()(outputs, labels)
Compute the cross entropy loss given outputs and labels.

Args:
    outputs: (Variable) dimension batch_size x 6 - output of the model
    labels: (Variable) dimension batch_size, where each element is a value in [0, 1, 2, 3, 4, 5]

Returns:
    loss (Variable): cross entropy loss for all images in the batch

Note: you may use a standard loss function from http://pytorch.org/docs/master/nn.html#loss-functions. This example
      demonstrates how you can easily define a custom loss function.
def loss_fn(outputs, labels):
    '\n    Compute the cross entropy loss given outputs and labels.\n\n    Args:\n        outputs: (Variable) dimension batch_size x 6 - output of the model\n        labels: (Variable) dimension batch_size, where each element is a value in [0, 1, 2, 3, 4, 5]\n\n    Returns:\n        loss (Variable): cross entropy loss for all images in the batch\n\n    Note: you may use a standard loss function from http://pytorch.org/docs/master/nn.html#loss-functions. This example\n          demonstrates how you can easily define a custom loss function.\n    '
    return nn.CrossEntropyLoss()(outputs, labels)