Attend the Women in ML Symposium on December 7

# tfa.losses.pinball_loss

Stay organized with collections Save and categorize content based on your preferences.

Computes the pinball loss between `y_true` and `y_pred`.

`loss = maximum(tau * (y_true - y_pred), (tau - 1) * (y_true - y_pred))`

In the context of regression this loss yields an estimator of the tau conditional quantile.

#### Usage:

````loss = tfa.losses.pinball_loss([0., 0., 1., 1.],`
`[1., 1., 1., 0.], tau=.1)`
`loss`
`<tf.Tensor: shape=(), dtype=float32, numpy=0.475>`
```

`y_true` Ground truth values. shape = `[batch_size, d0, .. dN]`
`y_pred` The predicted values. shape = `[batch_size, d0, .. dN]`
`tau` (Optional) Float in [0, 1] or a tensor taking values in [0, 1] and shape = `[d0,..., dn]`. It defines the slope of the pinball loss. In the context of quantile regression, the value of tau determines the conditional quantile level. When tau = 0.5, this amounts to l1 regression, an estimator of the conditional median (0.5 quantile).

`pinball_loss` 1-D float `Tensor` with shape [batch_size].

#### References:

[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing the information I need" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{ "type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }]
[{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }]