Cross entropy loss multi target - PyTorch Forums
https://discuss.pytorch.org › cross-...hello, I want to use one-hot encoder to do cross entropy loss for example input: [[0.1, 0.2, 0.8, 0, 0], [0,0, 2, 0,0,1]] target is [[1,0,1 ...
Cross entropy loss multi target - PyTorch Forums
discuss.pytorch.org › t › cross-entropy-loss-multiOct 15, 2020 · hello, I want to use one-hot encoder to do cross entropy loss for example input: [[0.1, 0.2, 0.8, 0, 0], [0,0, 2, 0,0,1]] target is [[1,0,1,0,0]] [[1,1,1,0,0]] I saw the discussion to do argmax of label to return index, but I have multiple 1s in one row, argmax will only return 1, how do I solve this problem?
Cross entropy loss multi target - PyTorch Forums
https://discuss.pytorch.org/t/cross-entropy-loss-multi-target/9954115.10.2020 · hello, I want to use one-hot encoder to do cross entropy loss for example input: [[0.1, 0.2, 0.8, 0, 0], [0,0, 2, 0,0,1]] target is [[1,0,1,0,0]] [[1,1,1,0,0]] I saw the discussion to do argmax of label to return index, but I have multiple 1s in one row, argmax will only return 1, how do I …
CrossEntropyLoss — PyTorch 1.10.1 documentation
pytorch.org › torchThe latter is useful for higher dimension inputs, such as computing cross entropy loss per-pixel for 2D images. The target that this criterion expects should contain either: Class indices in the range [ 0 , C − 1 ] [0, C-1] [ 0 , C − 1 ] where C C C is the number of classes; if ignore_index is specified, this loss also accepts this class ...