Binary cross-entropy measures how well predicted probabilities match binary targets. Its logarithmic penalty makes confidently wrong predictions especially costly. section 5.2.5
Name classification
For a model predicting whether a name is labeled female, binary cross-entropy can weight each example by the name’s frequency in the dataset. section 5.2.5
Equation 5.2 Binary cross-entropy
Inspect the binary cross-entropy equation for a single classification probability. section 5.2.5
>>> loss_func_train = torch.nn.BCELoss( ... weight=torch.Tensor(df[['count']][istrain].values)) >>> loss_func_test = torch.nn.BCELoss( #1 ... weight=torch.Tensor(df[['count']][~istrain].values)) >>> loss_func_train BCELoss()
See PyTorch’s BCELoss configured with dataset-frequency weights. section 5.2.5


















