<jupyter_start><jupyter_text>Check quantileloss functions obtained from [here](https://www.yuritan.nl/posts/prediction_uncertainty/)<jupyter_code>def LoopLoss(preds, target, quantiles):
    def _tilted_loss(q, e):
        return torch.max((q-1) * e, q * e).unsqueeze(1)

    err = target - preds
    losses = [_tilted_loss(q, err[:, i])  # calculate per quantile
              for i, q in enumerate(quantiles)]

    loss = torch.mean(torch.sum(torch.cat(losses, dim=1), dim=1))
    return loss
criterion = PinballLoss(quantiles)
criterion(y_pred, target)
pinball = PinballLoss(quantiles)
pinball.forward(y_pred, target)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1325115562403698, 'fraction_numerical': 0.0061633281972265025, 'mean_word_length': 4.6521739130434785, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '319843', 'license': 'MIT', 'n_tokens_mistral': 239, 'n_tokens_neox': 233, 'n_words': 46, 'path': 'src/check-quantileloss.ipynb', 'repo_name': 'Javicadserres/wind-production-forecast', 'size': '649'}